Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

grandM

macrumors 68000
Original poster
Oct 14, 2013
1,565
328
Hi guys

I'm having some problems with MVVM. So MVVM has a ViewModel. This ViewModel is fabricated out of the Model thinking of the View. That's clear.

Question remains if you instantiate the objects (needed for the View) in the Controller or in the ViewModel?

Thanks!
 
There really isn't a solid set of rules to abide by, but if the object you initiate is a component of the view, it probably belongs in the controller. If the object is just providing information for the view (content, view configuration), it should probably be in the View Model object.
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.