interactivePopGestureRecognizer右滑失效

当前界面如果是一级界面,此时右滑,触发pop,但界面已经是一级界面,pop不出去,此时界面内如果触发push,导致navigationViewcontroller 栈混乱,界面卡死。
解决办法:

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    
    self.navigationController.interactivePopGestureRecognizer.enabled = NO;    //让rootView禁止滑动
    self.navigationController.interactivePopGestureRecognizer.delegate = self;
}
#pragma mark -- 一级界面关闭右滑pop功能,否则页面会卡死
- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer*)gestureRecognizer {
    return NO;
}

你可能感兴趣的:(interactivePopGestureRecognizer右滑失效)