栈底控制器去掉左滑手势

@interface BaseNavigationController () <UINavigationControllerDelegate>

@end

@implementation BaseNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.delegate = self;
}

- (void)navigationController:(UINavigationController *)navigationController
       didShowViewController:(UIViewController *)viewController
                    animated:(BOOL)animated {
   if (viewController == navigationController.viewControllers[0]) {
       navigationController.interactivePopGestureRecognizer.enabled = NO;
   } else {
       navigationController.interactivePopGestureRecognizer.enabled = YES;
   }
}

@end

 

posted @ 2020-03-18 20:34  码出境界  阅读(129)  评论(0编辑  收藏  举报