简体   繁体   中英

Swipe to go back not working for iOS app

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM