使用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;
}
// }

posted @ 2015-11-13 16:15  XZoscar  阅读(235)  评论(0编辑  收藏  举报