Is it possible to turn page programmatically in UIPageViewController?
Is it possible to turn page programmatically in UIPageViewController ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes it is possible with the method:
That is the same method used for setting up the first view controller on the page. Similar, you can use it to go to other pages.
Wonder why
viewControllersis an array, and not a single view controller?That’s because a page view controller could have a “spine” (like in iBooks), displaying 2 pages of content at a time. If you display 1 page of content at a time, then just pass in a 1-element array.
An example in Swift: