March 2014
Intermediate to advanced
672 pages
40h 11m
English
In the simplest scenario, adding a child to a container controller takes three steps:
1. Call addChildViewController: on the parent and pass the child as the argument (for example, [self addChildViewController:childvc]).
2. Add the child controller’s view as a subview (for example, [self.view addSubview:childvc.view]).
3. Call didMoveToParentViewController: on the child with the parent as its argument (for example, [childvc didMoveToParentViewController:self]).
To remove a child view controller, the steps are almost (but not quite) mirrored:
1. Call willMoveToParentViewController: on the child, passing nil as the argument (for example, [childvc willMoveToParentViewController:nil]).
2. Remove the child ...
Read now
Unlock full access