Last active
April 17, 2017 00:45
-
-
Save diederikh/7c9862750040951497ce to your computer and use it in GitHub Desktop.
Transition to view controller within container view (called in performForSegue:)
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
- (void)switchToViewController:(UIViewController *)viewController | |
{ | |
UIViewController *currentViewController = self.childViewControllers[0]; | |
[self addChildViewController:viewController]; | |
[self transitionFromViewController:currentViewController toViewController:viewController duration:0.2 options:UIViewAnimationOptionTransitionCrossDissolve animations:^{} | |
completion:^(BOOL finished) { | |
[currentViewController removeFromParentViewController]; | |
[self.containerView addSubview:viewController.view]; | |
}]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment