Current Design
I currently have a view controller on my storyboard that has an embedded tab controller and an embedded navigation control. This view control also has a container view that shows a view dependent upon the value selected in the segmented control located in the navigation bar.
Loading Views for the Container View
The views for the container view are XIB files (not storyboard based) and are loaded programmatically:
- (void)viewDidLoad
{
[super viewDidLoad];
// First Controller
self.firstViewController = [[FirstViewController alloc] init];
// Second Controller
self.secondViewController = [[SecondViewController alloc] init];
// Add the controllers to an Array
self.controllers = @[self.firstViewController, self.secondViewController];
// Set the container to show the first view controller on load
[self displayContentController:[self.controllers firstObject]];
}
- (void)displayContentController:(UIViewController *)content
{
[self addChildViewController:content];
content.view.frame = [self frameForContentController];
[self.view addSubview:content.view];
[content didMoveToParentViewController:self];
// Set current controller
self.currentController = content;
}
The Problem I Face
The problem I have is that one of the views for the container view is a collection view that contains photos and I need to be able to push a view containing an image in large size when they select one of the cells.
How do I go about pushing a view onto the navigation controller in a view that is inside the container view?