1) Setup UIPageControl
let appearance = UIPageControl.appearance()
appearance.pageIndicatorTintColor = UIColor.grayColor()
appearance.currentPageIndicatorTintColor = UIColor.whiteColor()
appearance.backgroundColor = UIColor.darkGrayColor()
2) To update your UIPageControl indicator, override the following method:
-(NSInteger)presentationIndexForPageViewController:(UIPageViewController *)pageViewController
or
func presentationIndexForPageViewController(pageViewController: UIPageViewController) -> Int
Above method return index of page, for update your UIPageControl indicator.
0 nhận xét:
Đăng nhận xét