Search code examples
iosswiftuipageviewcontroller

Change dot to image for UIPageViewController


I have learnt recently that UIPageViewController is a good way to manage a multi-page scene and its built-in dot function is a good way to indicate the current page which is displayed.

But I wonder if I can change the dot system to something like images.

The reason asking is that I came across this app scene:

This scene consists of 3 views "details", "due date" and "budget", which are indicated by 3 "label"-like elements in the header. You need to click the button "continue" in the bottom to navigate forward. And when the page changes, the label corresponds to the current page is highlighted while the others are greyed out.

Really curious how this can be achieved. Do they change the dot to images or they just put up those static labels to the corresponding page's header section?


Solution

  • The screenshot you shared is not using UIPageViewController. It is using UISegmentedControl. Here is the link for Apple documentation.