I have been struggling with this issue for the last few days and after all this juggling I have figured out that all I need is the current Index from the datasource method to up
Implement Delegate Method
- (void)pageViewController:(UIPageViewController *)pageViewController didFinishAnimating:(BOOL)finished previousViewControllers:(NSArray *)previousViewControllers transitionCompleted:(BOOL)completed{
NSLog(@"Current Page = %@", pageViewController.viewControllers);
UIViewController *currentView = [pageViewController.viewControllers objectAtIndex:0];
if ([currentView isKindOfClass:[FirstPageViewController class]]) {
NSLog(@"First View");
}
else if([currentView isKindOfClass:[SecondPageViewController class]]){
NSLog(@"Second View");
}
else if([currentView isKindOfClass:[ThirdViewController class]]){
NSLog(@"Third View");
}
}
//pageViewController.viewControllers always return current visible View ViewController