1

By default the UINavigationController is pushing a new view controller from right to left. However, I need it to push from left to right to be accordance with my swipe gesture. Is there a way to do so? I am focusing on iOS 7.

HanXu
  • 5,187
  • 5
  • 45
  • 72
  • Take a look at this issue: http://stackoverflow.com/questions/2215672/how-to-change-the-push-and-pop-animations-in-a-navigation-based-app – Paulo May 13 '14 at 00:42
  • @Paulo, but I don't want flip animation, just ordinary move is OK...This post seems not helpful on this. – HanXu May 13 '14 at 01:01
  • HanXu, I am probably just going to state something you probably already know - there are very limited transition options from view to view and the list is the folioing: https://developer.apple.com/library/ios/documentation/uikit/reference/uiview_class/uiview/uiview.html#//apple_ref/c/tdef/UIViewAnimationOptions - I see what you mean - the simple right to left is not available - you probably want something right to left and back like a UIScrollview – Paulo May 13 '14 at 01:30

1 Answers1

1

In iOS 7 (only), you can easily do this with a custom transition animation. The animation can be automatic (the user taps a button and the animation just happens) or interactive (the user pans and the movement of the animation accompanies the gesture).

matt
  • 447,615
  • 74
  • 748
  • 977
  • This downloadable example project happens to be for a tab bar controller, not a navigation controller, but it does show how to bring in a view from either side (left gesture or right gesture), and the basic principles are _exactly_ the same as for a navigation controller: https://github.com/mattneub/Programming-iOS-Book-Examples/blob/master/bk2ch06p296customAnimation2/ch19p620customAnimation1/AppDelegate.m – matt May 13 '14 at 01:16