用户向后滑动时popToRootViewControllerAnimated

时间:2015-12-19 11:24:55

标签: ios uiswipegesturerecognizer

我有视图A,视图B和视图C.我已从视图A推出视图B并从视图B推视图C.

当用户点击视图C中的后退按钮时,我调用popToRootViewControllerAnimated,以便用户根本看不到视图B.

问题是如果用户在视图C中向后滑动,他们仍然会看到视图B.我不希望用户看到视图B并直接跳转到视图A.我该怎么办?

我目前使用xib。

1 个答案:

答案 0 :(得分:0)

您可以关闭向后滑动功能

if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}

以这种方式,用户只能通过您提供的按钮返回

相关问题