UIPageViewController transition 'Unbalanced calls to begin/end appearance transitions for '

前端 未结 10 1510
一生所求
一生所求 2021-02-01 20:10

When I navigate through UIPageViewController faster than its transition animation I am getting \'Unbalanced calls to begin/end appearance transitions for <

10条回答
  •  臣服心动
    2021-02-01 20:51

    My solution in swift, simple and working:

    1. Set pageviewcontroller delegate to your class
    2. Add below code

      extension MyPageVC: UIPageViewControllerDelegate {
      
          func pageViewController(_ pageViewController: UIPageViewController, willTransitionTo pendingViewControllers: [UIViewController]) {
              self.view.isUserInteractionEnabled = false
          }
      
          func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) {
              self.view.isUserInteractionEnabled = true
          }
      }
      

提交回复
热议问题