3

When i call

- (void)setViewControllers:(NSArray *)viewControllers 
                 direction:(UIPageViewControllerNavigationDirection)direction 
                  animated:(BOOL)animated 
                completion:(void (^)(BOOL finished))completion;

in UIPageViewController delegate

- (void)pageViewController:(UIPageViewController *)pageViewController 
        didFinishAnimating:(BOOL)finished 
   previousViewControllers:(NSArray *)previousViewControllers 
       transitionCompleted:(BOOL)completed;

I see that completion block not be called. But when i call this method outside of delegate method, the completion block is called. Do i config wrong? could you give me hint!

Thanks!

Alex Cio
  • 6,014
  • 5
  • 44
  • 74
Đông Hà
  • 222
  • 3
  • 16
  • Can you post your code, including the completion block? – lxt Mar 11 '13 at 11:03
  • Have you set up your delegate properly? – βhargavḯ Mar 11 '13 at 11:21
  • yes, datasource and delegate already set to self – Đông Hà Mar 13 '13 at 04:24
  • This code is call inside and outside of delegate method: ContentViewController *leftPage = [[ContentViewController alloc] initWithNibName:@"ContentViewController" bundle:nil]; ContentViewController *rightPage = [[ContentViewController alloc] initWithNibName:@"ContentViewController" bundle:nil]; [self.pageViewController setViewControllers:[NSArray arrayWithObjects:leftPage, rightPage, nil] direction: UIPageViewControllerNavigationDirectionForward animated:YES completion:^(BOOL finished){NSLog(@"completion block");}]; – Đông Hà Mar 13 '13 at 04:30
  • The problem seems related to http://stackoverflow.com/questions/24266420/uipageviewcontroller-didfinishanimating-not-called-if-swiped-quickly I can reproduce the problem by: 1. scroll to last page. 2. scroll to previous page a little bit then scroll very fast to end(for triggering the last page bouncing effect) – chakming Feb 03 '15 at 01:45

0 Answers0