Created
December 10, 2013 23:53
-
-
Save Nub/7902585 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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