Created
November 21, 2012 23:10
-
-
Save ianiv/4128445 to your computer and use it in GitHub Desktop.
UINavigationController custom transitions
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
// With transitionWithView | |
[UIView transitionWithView:self.navigationController.view | |
duration:0.5 | |
options:UIViewAnimationOptionTransitionFlipFromBottom | |
animations:^{ | |
[self.navigationController pushViewController:viewController animated:NO]; | |
} | |
completion:nil]; | |
// With CATransition | |
CATransition *transition = [CATransition animation]; | |
transition.duration = 0.3f; | |
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseOut]; | |
transition.type = kCATransitionMoveIn; | |
transition.subtype = kCATransitionFromTop; | |
[self.navigationController.view.layer addAnimation:transition forKey:nil]; | |
[self.navigationController pushViewController:viewController animated:NO]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment