且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在iOS 7上的UINavigationController中禁用后滑动手势

更新时间:2023-11-21 12:35:34

我找到了解决方案:

Objective-C:

if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
    self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}

Swift 3:

self.navigationController?.interactivePopGestureRecognizer?.isEnabled = false