Access the UIPageControl created by iOS6 UIPageViewController?

后端 未结 8 1174
盖世英雄少女心
盖世英雄少女心 2021-01-05 02:42

I\'m using a UIPageViewController with Navigation set to Horizontal, Transition Style set to Scroll (in InterfaceBuilder), and no spine. Which gives me a lovely

8条回答
  •  情歌与酒
    2021-01-05 03:11

    Swift 3 Extension:

    extension UIPageViewController {
        var pageControl: UIPageControl? {
            for view in view.subviews {
                if view is UIPageControl {
                    return view as? UIPageControl
                }
            }
        return nil
        }
    }
    

提交回复
热议问题