我发现在使用自定义后退操作时,交互式弹出手势会停止工作。
要解决此问题,您可以将interactivePopGestureRecognizer.delegate属性设置为nil。
试试这个:
class NavigationController: UINavigationController, UIGestureRecognizerDelegate { /// Custom back buttons disable the interactive pop animation /// To enable it back we set the recognizer to `self` override func viewDidLoad() { super.viewDidLoad() interactivePopGestureRecognizer?.delegate = self } func gestureRecognizerShouldBegin(gestureRecognizer: UIGestureRecognizer) -> Bool { return viewControllers.count > 1 } }