控制器的左侧滑返回手势
开启此功能-----
- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; // 在此决定是否开启左侧侧滑返回功能 if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { self.navigationController.interactivePopGestureRecognizer.delegate = nil; self.navigationController.interactivePopGestureRecognizer.enabled = self.navigationController.viewControllers.count - 1; } }
关闭此功能-----
- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; // 在此决定是否开启左侧侧滑返回功能 if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { self.navigationController.interactivePopGestureRecognizer.enabled = NO; } }