iOS开发 自定义navigationleftItem 之后手势失效的问题

时间:2023-11-10 19:21:20
@property (nonatomic, strong) UIViewController *currentShowVC;

    //设置代理

    self.navigationController.interactivePopGestureRecognizer.delegate =(id)self;

    self.navigationController.interactivePopGestureRecognizer.enabled = YES;

    ){

        //将当前导航控制器置空

        self.currentShowVC = Nil;

    }else{

        self.currentShowVC = self;

    }

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer

{

    if (gestureRecognizer == self.navigationController.interactivePopGestureRecognizer) {

        //the most important

        return (self.currentShowVC == self.navigationController.topViewController);

    }

    return YES;

}

    self.navigationController.interactivePopGestureRecognizer.delegate = self;

待整理。。。。。