Push ViewController from Right To Left with UINavigationController
Try this :
//Push effect in reverse way
CATransition* transition = [CATransition animation];
transition.duration = 0.75;
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromLeft;
[self.navigationController.view.layer addAnimation:transition forKey:kCATransition];
[self.navigationController pushViewController:vc animated:NO];
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];
Please try this one
HomePageController *pageView = [[HomePageController alloc] initWithNibName:@"HomePageController_iPhone" bundle:nil];
CATransition *transition = [CATransition animation];
transition.duration = 0.45;
transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionDefault];
transition.type = kCATransitionPush;
transition.subtype = kCATransitionFromLeft;
transition.delegate = self;
[self.navigationController.view.layer addAnimation:transition forKey:nil];
self.navigationController.navigationBarHidden = NO;
[self.navigationController pushViewController:pageView animated:NO];