In my custom UIPageViewController class:
UIPageViewController
- (id)initWithCoder:(NSCoder *)aDecoder { self = [super initWithCoder:aDecoder]; if (self) {
SWIFT 4.2
func presentationIndex(for pageViewController: UIPageViewController) -> Int { guard let currentController = pageViewController.viewControllers?.first else { return 0 } guard let index = viewControllerList.index(of: currentController) else { return 0 } return index }