在全局的父控制器中添加以下代码:
- (void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:YES];
if (self.navigationController.viewControllers.count == 1) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
self.navigationController.interactivePopGestureRecognizer.delegate = nil;
}
}