InteractivePopGestureRecognizer causing app freezing

前端 未结 9 1874
再見小時候
再見小時候 2021-01-31 10:29

In my app I have different controllers. When I push controller1 to navigation controller and swipe to back, all works good. But, if I push navigation controller1, and into contr

9条回答
  •  半阙折子戏
    2021-01-31 10:56

    I would suggest you to try this. This works perfectly for me. You can still enjoy Interactive swipe.

    - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
      if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)] &&
          gestureRecognizer == self.navigationController.interactivePopGestureRecognizer) {
        if(self.navigationController.viewControllers.count<=1)
        {
          return NO;
        }
      }
      return YES;
    }
    

提交回复
热议问题