Flip animation when controller pushed on iPhone

chacha picture chacha · Mar 24, 2010 · Viewed 17.6k times · Source

I had a look around and didn't find what I was exactly looking for.

Is there a way to get a flip animation when pushing a view controller?

I read that you can change the animation by using a modal view controller but AFAIK the animation for a modal view is from bottom to top and that's not what i am looking for. Is there a way to get a flip animation somehow?

Answer

John picture John · May 27, 2010

something like this should work

[UIView beginAnimations:@"animation" context:nil];
[self.navigationController pushViewController: yourviewcontroller animated:NO]; 
[UIView setAnimationTransition:UIViewAnimationTransitionFlipFromLeft forView:self.navigationController.view cache:NO]; 
[UIView commitAnimations];

don't forget to set animated to NO when calling pushViewController