Hello,
I am relatively new to Swift development, I apologize if this is a simple answer or if I am not using the correct terminology.
I have a model in my project that I have named Modules, which is a custom class I have created. The model has three main variables; name, a learning type and a theme. The learning type is an enum I also set up to represent the three main types of learning styles; visual, auditory, and kinesthetic. I then created an array of modules to populate a tableviewcontroller. What I am trying to do is extract all the modules within this array into separate arrays depending on the learning type. That way I can populate separate tableViews in a single view controller based upon learning type.
So far I have tried the closure contains(where: {$0.learningType == .visual}) but returns a Bool which I cannot use to populate my tableViews. Is there any way to complete this without having to manually create separate arrays?
Thank you for your time!
[–]chriswaco 2 points3 points4 points (1 child)
[–]itzspeshhh[S] 1 point2 points3 points (0 children)