@property (nonatomic, strong) UIViewController *currentShowVC; //设置代理 self.navigationController.interactivePopGestureRecognizer.delegate =(id)self; self.navigationController.interactivePopGestureRecognizer.enabled = YES; if (self.navigationController.viewControllers.count == 1){ //将当前导航控制器置空 self.currentShowVC = Nil; }else{ self.currentShowVC = self; } - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { if (gestureRecognizer == self.navigationController.interactivePopGestureRecognizer) { //the most important return (self.currentShowVC == self.navigationController.topViewController); } return YES; } self.navigationController.interactivePopGestureRecognizer.delegate = self;
待整理。。。。。
时间: 2024-10-11 18:14:51