I have a compex UIViewController (and related view). It consists of several subviews with their own view controllers. (e.g. few UITableViewController subclasses, custom ViewContorllers etc.).
Do you think that will be a good decision to store references of child view controllers in the root View (not view controller class). I'm building the view structure in the root view class right now like that (one of the few methods for adding view/viewcontroller):
- (void)addCaroucel
{
_caroucelViewController = [[CaroucelTableViewController alloc] init];
_caroucelViewController.caroucelView.delegate = self;
[self addSubview:_caroucelViewController.caroucelView];
}
I understand that controllers somehow should be in main controller but in the same time this is like internal implementation of the view and I don't want to disclose it with main view controller. And I think that view hierarchy should be build in the view class, not in the view controller.
Do you see any better solution?