Showing pushviewcontroller animation look like presentModalViewController

sathish kumar picture sathish kumar · Oct 1, 2010 · Viewed 42.9k times · Source

Is it possible to show pushViewController animation look like presentModalViewController but that has background functionality of pushViewController?

Answer

steipete picture steipete · Mar 28, 2011

If you want to a fade animation, this approach works.

CATransition* transition = [CATransition animation];
transition.duration = 0.3;
transition.type = kCATransitionFade;
transition.subtype = kCATransitionFromTop;

[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController pushViewController:gridController animated:NO];