首先写这个方法
-(void)popGestureChange:(UIViewController *)vc enable:(BOOL)enable{
if ([vc.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
//遍历所有的手势
for (UIGestureRecognizer *popGesture in vc.navigationController.interactivePopGestureRecognizer.view.gestureRecognizers) {
popGesture.enabled = enable;
}
}
}
然后在viewDidAppear这个方法里面调用
- (void)viewDidAppear:(BOOL)animated{
[superviewDidAppear:animated];
[self popGestureChange:self enable:NO];
}