美文网首页
禁止页面右滑pop回页面

禁止页面右滑pop回页面

作者: 张家杰仔 | 来源:发表于2017-06-05 15:06 被阅读17次
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

    self.navigationController.interactivePopGestureRecognizer.delegate = self;
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];

    self.navigationController.interactivePopGestureRecognizer.delegate = nil;
}

// 给该控制器添加协议 <UIGestureRecognizerDelegate>

- (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer
{
    return gestureRecognizer != self.navigationController.interactivePopGestureRecognizer;
}

相关文章

网友评论

      本文标题:禁止页面右滑pop回页面

      本文链接:https://www.haomeiwen.com/subject/xlwifxtx.html