- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]){
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
self.navigationController.interactivePopGestureRecognizer.delegate =self;
}
}
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
if([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
self.navigationController.interactivePopGestureRecognizer.delegate =nil;
}
}
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer*)gestureRecognizer
{return NO; //YES:允许右滑返回 NO:禁止右滑返回
}