Skip to content

Instantly share code, notes, and snippets.

@amster
Created February 25, 2014 01:49
Show Gist options
  • Save amster/9201087 to your computer and use it in GitHub Desktop.
Save amster/9201087 to your computer and use it in GitHub Desktop.
// Assuming again pageViewController.viewControllers returns the
// NSArray of UIViewControllers and the object at index 0 is the
// current view controller---which has a property idx indicating
// the current page.
- (NSInteger)presentationIndexForPageViewController:(UIPageViewController *)pageViewController {
int currentPage = [[pageViewController.viewControllers objectAtIndex:0] idx];
return currentPage;
}
// MAX_PAGES is the total # of pages.
- (NSInteger)presentationCountForPageViewController:(UIPageViewController *)pageViewController {
return MAX_PAGES;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment