I want to get current index of a pageViewController, I don\'t know how I get the visible pages index.
func pageViewController(pageViewController: UIPageViewContr
Add this code to your UIPageViewController.
UIPageViewController
var pages = [UIViewController]() var currentIndex: Int { guard let vc = viewControllers?.first else { return 0 } return pages.firstIndex(of: vc) ?? 0 }