码迷,mamicode.com
首页 > 移动开发 > 详细

iOS开发-iOS7禁用手势返回

时间:2015-08-20 12:12:29      阅读:147      评论:0      收藏:0      [点我收藏+]

标签:

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

    // 禁用 iOS7 返回手势
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.navigationController.interactivePopGestureRecognizer.enabled = NO;
    }
}

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

    // 开启
    if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        self.navigationController.interactivePopGestureRecognizer.enabled = YES;
    }
}

  

iOS开发-iOS7禁用手势返回

标签:

原文地址:http://www.cnblogs.com/feiling/p/4744312.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!