I have a UIViewController (MainViewController
) which manages a view with two subviews, which I created using storyboard. Now I want these two sub views to be managed by their own model controllers, so most of the work done by the app is distributed instead of being central to this one controller.
I tried setting the view on the view controllers, but it doesn't work (at least viewDidLoad
on the other controllers does not get called, although the views show). In MainViewController
's viewDidLoad
I have this:
MainNavigationViewController* navigationViewController = [[MainNavigationViewController alloc] init];
MainContentViewController* contentViewController = [[MainContentViewController alloc] init];
navigationViewController.view = self.navigationView;
contentViewController.view = self.contentView;
How can I do this? And more, is this a good idea?