Push ViewController from Right To Left with UINavigationController

You can create a NSMutableArray from the navigationController’s array of viewcontrollers and insert new viewController before the current one. Then set the viewControllers array without animation and pop back.

UIViewController *newVC = ...;
NSMutableArray *vcs =  [NSMutableArray arrayWithArray:self.navigationController.viewControllers];
[vcs insertObject:newVC atIndex:[vcs count]-1];
[self.navigationController setViewControllers:vcs animated:NO];
[self.navigationController popViewControllerAnimated:YES];

Leave a Comment