废话不多说直接撸代码:
在视图控制器中实现:self.navigationController.interactivePopGestureRecognizer.delegate = (id)self;
在代理方法返回yes之前做处理就OK了,一般我们是实现回调
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
if (gestureRecognizer == self.navigationController.interactivePopGestureRecognizer) {
self.imgBlock(self.imageArray);
return YES;
}
return NO;
}
下边这段话是看别人的:
如果在tabBarController的界面上,快速的向右或向左滑动单元格2次,界面会假死,无法点击?(此问题用真机调试会更容易出现)
-(void)viewDidAppear:(BOOL)animated{ [superviewDidAppear:animated]{if([selfisKindOfClass:[OneViewController class]]||[selfisKindOfClass:[TwoViewController class]]||[selfisKindOfClass:[ThreeViewController class]]||[selfisKindOfClass:[FourViewController class]]||[selfisKindOfClass:[FiveViewController class]]) {self.navigationController.interactivePopGestureRecognizer.enabled=NO; }else{self.navigationController.interactivePopGestureRecognizer.enabled=YES; }}
文/Dev_Pyy(简书作者)
原文链接:http://www.jianshu.com/p/faf81bc51b3c
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
网友评论