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

前端 未结 10 1508
一生所求
一生所求 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 21:06

    How about this:

    - (void)pageViewController:(UIPageViewController*)pgVC willTransitionToViewControllers:(NSArray*)pendingVCs
    {
        pgVC.dataSource = nil; // ... to disallow user to change pages until animation completes
    }
    
    - (void)pageViewController:(UIPageViewController*)pgVC
            didFinishAnimating:(BOOL)finished
       previousViewControllers:(NSArray*)prevVCs
           transitionCompleted:(BOOL)completed
    {
        if(completed || finished) {
            pgVC.dataSource = _pgViewDataSource; // ... to allow user to change pages again
        }
    }
    

提交回复
热议问题