Sonic Master Sonic Master - 1 year ago 114
Swift Question

Add UIPageControl to UIPageViewController via storyboard

I try to create onboarding page by following this tutorial and it works great.

That link suggest to create every page onboarding as single view controller using storyboard, then wrap it on my class which is subclass of


By following that tutorial, I already created nice onboarding page but there is one question remaining. Basically, I created each page of my onboarding pages using storyboard and create its class subclassing
. Then I dragged
which is my initial view controller. The result is created onboarding page that has black dot indicator on bottom page. I try to move that indicator and modify it, but still has no clue.

So my first step is remove implementation of its datasource method
, my indicator has disappear.

My question is, where should I add
so my onboarding page doesn't use its bottom indicator?

Any help would be appreciated. Thank you!

Answer Source

Subclass UIPageViewController is not the best idea. Better is to create a container view controller for UIPageViewController that will conform to UIPageViewControllerDataSource and UIPageViewControllerDelegate. Using storyboard you can add to you container view controller's view a container view that load your UIPageViewController. Get your UIPageViewController from -prepareForSegue:sender: method to configure. Now you're able to manage your UIPageViewController from container view controller. Good luck!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download