Changing UIPageViewController's page programmatically doesn't update the UIPageControl

后端 未结 7 1734
悲哀的现实
悲哀的现实 2020-12-09 17:39

In my custom UIPageViewController class:

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
           


        
7条回答
  •  离开以前
    2020-12-09 18:14

    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
    }
    

提交回复
热议问题