0

I have a storyboard with few UINavigationControllers and UIViewControllers.

Main.storyboard

When I performSegueWithIdentifier(..) from the second to third window default animation is right to left slide. But when I performSegueWithIdentifier(..) from the third window to UINavigationController the animation is from bottom to top slide. How to set UIViewController -> UINavigationController animation to one like UIViewController -> UIViewController?

Patrick
  • 1,629
  • 5
  • 23
  • 44
Roo
  • 613
  • 1
  • 7
  • 24

1 Answers1

1
YOURVC *vc = [[YOURVC alloc]init];
UINavigationController *VCNavigation = [[UINavigationController alloc]initWithRootViewController:vc];

And when you are calling from 1 to 3 or any call

[self.navigationController pushViewController:vc animated:YES];

or from 2 to 1 also you can call like this and instead you can call

[self.navigationController popViewControllerAnimated:YES];

or to root view controller use

[self.navigationController popToRootViewControllerAnimated:YES];

or to a particular vc

[self.navigationController popToViewController:yourvc Animated:YES];

Then if you want to show navigation keep it, or if you want to hide you can hide it.

Santo
  • 1,611
  • 3
  • 17
  • 37
  • I know how to navigate between controllers, but will it fix the animation issue? – Roo May 27 '16 at 09:45
  • yes by navigation it will animate to left , when you use presentViewController method it will come from bottom to top. – Santo May 27 '16 at 10:07