简体   繁体   English

滑动即可返回,不适用于iOS应用

[英]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. 我试图允许在iOS 7+中找到“向后滑动”功能,但在我的应用中无法使用。 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? 有什么办法可以获取错误消息或NSLog来检测为什么它不起作用?

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. 如果要在IB中设置序列,只需选择“ 显示”选项。 Popovers aren't dismissed with a Back button. 弹出窗口不会通过“后退”按钮消除。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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