使用ios系统侧滑 7.x 之后
-
-
- (id)initWithRootViewController:(UIViewController *)rootViewController {
if (self = [super initWithRootViewController:rootViewController]) {
self.interactivePopGestureRecognizer.delegate = self;
}
return self;
}
// { fixed 侧滑引起的bug @xzoscar
- (void)navigationController:(UINavigationController *)navigationController
didShowViewController:(UIViewController *)viewController
animated:(BOOL)animated {
if (navigationController.viewControllers.count == 1) {
self.activeVController = nil;
}else {
self.activeVController = viewController;
}
}
-(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
if (gestureRecognizer == self.interactivePopGestureRecognizer) {
return (self.activeVController == self.topViewController)?YES:NO;
}
return YES;
}
// }