Skip to content
Snippets Groups Projects
Commit 10be72bc authored by jakobsbode's avatar jakobsbode
Browse files

update page control, if pages set programmatically

parent bdc9aa43
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,13 @@ class IntroPageViewController: UIPageViewController {
self.view.backgroundColor = .white
view.addSubview(pageControl)
}
override func setViewControllers(_ viewControllers: [UIViewController]?, direction: UIPageViewControllerNavigationDirection, animated: Bool, completion: ((Bool) -> Void)? = nil) {
if let viewControllers = viewControllers, let controller = viewControllers.first, let index = orderedViewControllers.index(of: controller) {
self.pageControl.currentPage = index
}
super.setViewControllers(viewControllers, direction: direction, animated: animated, completion: completion)
}
}
extension IntroPageViewController: UIPageViewControllerDataSource {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment