How do I use UIPageControl to create multiple views?

You’ll want to use a UIScrollView, and then, as a sibling, position the UIPageControl over it. Then put each of your pages into the scroll view and turn paging on for it. This way each ‘flick’ will move the scroll view one page over.

Now, assign your view controller to be the delegate of the scroll view, and watch for scrollViewDidEndScrollAnimation, and use the contentOffset to determine which page is current.

Leave a Comment