I have a container with 4 navigation buttons, each representing 4 individual child vc. I have successfully implement the code to go from the container to the child vc using addchildviewcontroller
however now I do not know how to go back.
Container VC: 4 Buttons navigating to 4 separate child view controllers.
When the button is clicked the current view is replaced by the view of the Child VC. Therefore the buttons are no longer visible. For this very reason the child VC has a home button specifically designed to return to the container VC where the 4 buttons are residing.
Example of 1 of 4 Buttons Calling a function to display child VC:
- (IBAction)btn_bus:(id)sender {
[self addMyController:businessVC_];
}
Adding Child View Controllers, function called when button is clicked:
-(void)addMyController:(UIViewController *)myController{
[self addChildViewController:myController];
[self.view addSubview:myController.view];
[myController didMoveToParentViewController:self];
}
Question 1: How do you trap/perform functions on a child VC. For example how do I get the Home button on my Child VC to now cause the child vc to remove itself and once again show the container/nav screen?
Question 2: Where are these procedures to take place in the custom container VC or child VC?
Question 3: Is there in particular a guide or tutorial that shows how the relationship of IBAction and IBOutlet are managed in a Parent-Child Relationship?