You know a page control, right? It is used to indicate the existence of more pages than the current one fitting on the screen. The user can swipe to see them.

If you want to specify how many pages there are, you can set the numberOfPages property and you can change the current page by changing the value of currentPage.
However, you should consider the order of the commands!
You could get into the situation where you set the currentPage before you set numberOfPages and you assume that everything works if you are not changing the numberOfPages to a different value.
For example in a paged ScrollView, when you calculate the number of items after a swipe and don't expect a change.
If you do not watch out for the order of both commands, UIKit will do strange things to your currentPage.
In my case, the first three pages were set correctly, followed by number four and five where the currentPagewas not updated at all.
I am writing these lines to help prevent you from issues like this.