The app I’m currently working on has a UIPageViewController that has 3 ViewControllers.
I’m scrolling through these fine. No problems - either in portrait OR landscape.
I added a UIPageControl to the UIPageViewController, in code - not in the Storyboard, and as such, in portrait mode, I have a nice sequence of dots that show the scroll position through my paged ViewControllers.
That all works great.
EXCEPT, when I rotate into landscape.
When in landscape the UIPageViewController and the 3 ViewControllers work perfectly; scrolling and showing content and are interactive.
However the UIPageControl indicator as ‘vanished’.
Now, I will preface this with the fact that my UIPageViewController is part of a larger UITabBarViewController project, and as such at the bottom of the screen is a Tab Bar.
But when in portrait, I specifically positioned the UIPageControl (in code) to be ‘above’ that tab bar, and it is, and it displays, but it’s totally gone in landscape.
Can anyone PLEASE help me?
This is the code I used to ‘add’ the UIPageControl:
private func configurePageControl()
{
self.pageControl = UIPageControl(frame: CGRect(x: 0, y: UIScreen.main.bounds.maxY - 90, width: UIScreen.main.bounds.width, height: 50))
self.pageControl.numberOfPages = orderedViewControllers.count
self.pageControl.currentPage = 0
self.pageControl.tintColor = UIColor.white
self.pageControl.pageIndicatorTintColor = UIColor.black
self.pageControl.currentPageIndicatorTintColor = UIColor.white
self.view.addSubview(self.pageControl)
}
And that code is in the UIPageViewController where nothing but the handling of the 3 separate view controllers lives.
Thanks.