PageViewController current page index in Swift

前端 未结 12 2108
你的背包
你的背包 2021-02-01 15:37

I want to get current index of a pageViewController, I don\'t know how I get the visible pages index.

func pageViewController(pageViewController: UIPageViewContr         


        
12条回答
  •  孤独总比滥情好
    2021-02-01 16:09

    Try it..

    func pageViewController(pageViewController: UIPageViewController,didFinishAnimating finished: Bool,previousViewControllers: [UIViewController],transitionCompleted completed: Bool){
    guard completed else { return }
    
    self.pageControl.currentPage = pageViewController.viewControllers!.first!.view.tag
        }
    

提交回复
热议问题