Skip to content

Instantly share code, notes, and snippets.

@Nub
Created December 10, 2013 23:53
Show Gist options
  • Select an option

  • Save Nub/7902585 to your computer and use it in GitHub Desktop.

Select an option

Save Nub/7902585 to your computer and use it in GitHub Desktop.
Segue
- (void)perform {
self.contentController.modalPresentationStyle = UIModalPresentationCustom;
self.contentController.transitioningDelegate = self.tabBarController;
// Orientation works properly.
// [self.tabBarController addChildViewController:self.contentController];
// self.contentController.view.frame = self.tabBarController.tabContentView.bounds;
// [self.tabBarController.tabContentView addSubview:self.contentController.view];
// Boo no orientation
[self.tabBarController presentViewController:self.contentController animated:self.animated completion:nil];
}
Animator
- (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionContext {
// Grab the from and to view controllers from the context
VerticalTabBarViewController* tabBarController = (VerticalTabBarViewController*)[transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey];
UIViewController *contentController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey];
// [transitionContext.containerView addSubview:contentController.view];
if (self.presenting) {
contentController.view.frame = tabBarController.tabContentView.bounds;
[tabBarController addChildViewController:contentController];
[tabBarController.tabContentView addSubview:contentController.view];
}
else {
[contentController.view removeFromSuperview];
}
[transitionContext completeTransition:YES];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment