charles charles - 11 months ago 161
iOS Question

UIPageViewController delegate method not called

In my application I have a RootViewController (UIPageViewController), a FirstController (UIViewController) and a SecondController (UIViewController).
The two views inside the two UIViewControllers scroll over the RootViewController.

In my RootViewController.h:

@interface RootController : UIPageViewController <UIPageViewControllerDataSource, UIPageViewControllerDelegate>

But when I scroll between different views delegate methods like:

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

are not called.
Why? Can someone help me? Thank you in advance.

Answer Source

Did you assign rootViewController (whichever controller/object you want to receive the delegate calls) to be the delegate/datasource of the UIPageViewController?

pageViewController.delegate = rootViewController;
pageViewController.dataSource = rootViewController;