Reputation: 139
I have coding experience, but I'm new to the world of MVCs.
I understand Models and Views, and I understand controllers conceptually, but I'm having trouble figuring out exactly how they work.
Would I have one controller for each possible screen state in the app?
Upvotes: 1
Views: 49
Reputation: 69047
Would I have one controller for each possible screen state in the app?
If by "screen" you mean view, then a single controller can manage all the different states of the screen (i.e., view).
If by "screen state" you mean view, then the answer could be yes: one controller will manage one view.
At least, if you aim at a rather canonical MVC implementation.
If you look at the interface of any SDK controller class (e.g. UITableViewController
, UIViewController
, etc) you will see that a controller has got just one single reference to a view object.
Upvotes: 2