ios7 禁用手势滑动返回功能

- (void)viewDidAppear:(BOOL)animated

{

[super viewDidAppear:animated];


if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {

// 禁用 iOS7 返回手势self.navigationController.interactivePopGestureRecognizer.enabled = NO;

}

}

- (void)viewWillDisappear:(BOOL)animated

{

[super viewWillDisappear:animated];


if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {

// 开启

self.navigationController.interactivePopGestureRecognizer.enabled = YES;

}

}

推荐阅读更多精彩内容