iOS BUG收录

2019-05-08  本文已影响0人  舒翱

1. 使用系统测滑手势时,当视图处于根页面时点击cell的同时测滑或测滑再点击Cell 当前页面就会卡死,特记录一下解决方法:

//遵守UINavigationControllerDelegate协议
//@interface MyNavigationController ()<UINavigationControllerDelegate>
HomeViewController *home = [[HomeViewController alloc] init];
UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:home];
nav.delegate = self;
//或在UINavigationControllerDelegate类中self.delegate = self;
//实现代理方法
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
    //set gesture yes when showViewController 
    if ([navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
        navigationController.interactivePopGestureRecognizer.enabled = YES;
    }
    
    // if rootViewController, set delegate nil
    if (navigationController.viewControllers.count == 1) {
        navigationController.interactivePopGestureRecognizer.enabled = NO;
        navigationController.interactivePopGestureRecognizer.delegate = nil;
    }
}

问题解决链接:https://www.jianshu.com/p/4314b8569c2b

上一篇下一篇

猜你喜欢

热点阅读