Swipe to go back not working for iOS app

3.1k views Asked by At

I am trying to allow the "Swipe to go back" feature found in iOS 7+, but it isn't working in my app. I have added

 nc.interactivePopGestureRecognizer.delegate = (id<UIGestureRecognizerDelegate>)self;
    [nc.interactivePopGestureRecognizer setEnabled:YES];

but it simply refuses to work. I have a navigation controller at startup and then I have the "present as popover" segment from view to view. Is there any way I can get an error message or an NSLog to detect why it isn't working?

1

There are 1 answers

10
Dave Batton On BEST ANSWER

No code changes should be necessary for this feature. If you push a view controller onto a navigation stack, it should just work. Rather than trying to figure out the code to make it work, you'll need to find out what you did to break it.

This feature is designed to work with view controllers pushed onto the navigation controller. You shouldn't use "Present as Popover" for that. If you're setting up a segue in IB, just select the Show option. Popovers aren't dismissed with a Back button.