UINavigationController interactivePopGesture
iOS7 之后,引入交互手势,在NavigationController 的交互手势是 UIScreenEdgePanGestureRecognizer, 继承自 UIPanGestureRecognizer。在本次交互手势启用中,遇到的问题
- 自定义leftBarItem (返回按钮)不响应交互手势了。
- navigationController 的 RootViewController 上多滑动几次卡死了。
- UIViewController 上 有 ScrollView,TableView, UIWebView。
- 如何开启/关闭 interactivePopGesture?
- self.navigationController.interactivePopGesture.delegate = self;
- 代码如下
- - (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
}
- - (void)viewDidDisappear:(BOOL)animated {
- [self.myWeb