Thứ Ba, 28 tháng 7, 2015

Swift: working with UIPageViewController

With UIPageControl:
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.





- Comments

0 nhận xét:

Đăng nhận xét