How to push viewController with flip animation

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1];
[UIView setAnimationCurve:UIViewAnimationCurveEaseIn];
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.view cache:YES];
alarmViewController = [[AlarmViewController alloc] init];
[self.navigationController pushViewController:alarmViewController animated:YES];
[alarmViewController release];
[UIView commitAnimations];

      

I just want the viewcontroller to flip like opening a book page, but it doesn't work like that. And I have a question, can a navigationController animate this effect?

+1


source to share


1 answer


Since you are already placing navigationController

in the animation block. Mark animated:NO

-

[self.navigationController pushViewController:alarmViewController animated:NO];



when we actually call pushViewController:

, we set the animated value to NO. This disables the default animation for the navigation manager. Instead, the code block uses a specific transition.

+1


source







All Articles