Created
March 6, 2015 08:23
-
-
Save adriantofan/23d01c97a9f47f722495 to your computer and use it in GitHub Desktop.
add/remove childviewcontroller
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[self addChildViewController:vc]; | |
// [vc willMoveToParentViewController:self] called automatically | |
[self.view addSubview:vc.view]; // or something like this. | |
[vc didMoveToParentViewController:self]; | |
// For removing view controllers: | |
[vc willMoveToParentViewController:nil]; | |
[vc.view removeFromSuperview]; // or something like this | |
[vc removeFromParentViewController]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment