mercredi 23 août 2017

Can view models own/talk to other view models?

I'm building a complex view in which i'm presenting two collection views, i will need my view model to communicate with several different models to display data for each collection view. I will also need to transform that model data (for each model) to be represented in the collection view cell relative to the appropriate collection view. So i was thinking about creating a view model for each model to interpret/transform the data and then store an array of each of these view models inside my main view model so i can then use those array of view models as data sources for my collection views.

So is creating an array of different view models inside another view model sensible? OR could i inject several view models at once inside the view controller?

Aucun commentaire:

Enregistrer un commentaire