我想获取一个pageViewController的当前索引,我不知道我如何获取可见页索引.
func pageViewController(pageViewController: UIPageViewController,didFinishAnimating finished: Bool,prevIoUsViewControllers: [UIViewController],transitionCompleted completed: Bool) { // How to get it? }
解决方法
您可以使用didFinishAnimating,并将标签设置为查看控制器.尝试这个
func pageViewController(pageViewController: UIPageViewController,transitionCompleted completed: Bool) { if (!completed) { return } self.pageControl.currentPageIndex = pageViewController.viewControllers!.first!.view.tag //Page Index }