Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save bleeckerj/e68a893a6dbf0b02d18de2bd0f12ce84 to your computer and use it in GitHub Desktop.

Select an option

Save bleeckerj/e68a893a6dbf0b02d18de2bd0f12ce84 to your computer and use it in GitHub Desktop.
Transition to view controller within container view (called in performForSegue:)
- (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