Created
August 13, 2012 05:03
-
-
Save trivektor/3337103 to your computer and use it in GitHub Desktop.
Push and pop animation for UINavigationController
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
| // Copied from http://stackoverflow.com/questions/2215672/how-to-change-the-push-and-pop-animations-in-a-navigation-based-app | |
| For Push: | |
| MainView *nextView=[[MainView alloc] init]; | |
| [UIView beginAnimations:nil context:NULL]; | |
| [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; | |
| [UIView setAnimationDuration:0.75]; | |
| [self.navigationController pushViewController:nextView animated:NO]; | |
| [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromRight forView:self.navigationController.view cache:NO]; | |
| [UIView commitAnimations]; | |
| [nextView release]; | |
| For Pop: | |
| [UIView beginAnimations:nil context:NULL]; | |
| [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; | |
| [UIView setAnimationDuration:0.75]; | |
| [UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO]; | |
| [UIView commitAnimations]; | |
| [UIView beginAnimations:nil context:NULL]; | |
| [UIView setAnimationDelay:0.375]; | |
| [self.navigationController popViewControllerAnimated:NO]; | |
| [UIView commitAnimations]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment