美文网首页
iOS BUG收录

iOS BUG收录

作者: 舒翱 | 来源:发表于2019-05-08 16:18 被阅读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

    相关文章

      网友评论

          本文标题:iOS BUG收录

          本文链接:https://www.haomeiwen.com/subject/tjcvoqtx.html