Swift UIPageViewController trigger new page through button

Is it possible to disable the page chance trigger through swiping and trigger the new page only through a button?


In the picture you can see what I try to do. I have a ViewController and the PageViewController is embed in it. The Button is on the bottom of that ViewController. The button shouldn't move.

It should always stay the same position but the text and picture above should change to the next ViewController ( the ViewController do not all have the same layout. Some have pictures and some do not have) of the PageViewController.


Or is the PageViewController the wrong way for this? If you have an idea would be awesome if you can help me.

Yours sincerelly

Tell aka. Relbot

Accepted Reply

Looks like you don't want the pageView behavior.


A possibility here would be either:

- just use a navigation controller

or even,

- keep a simple ViewController with the button at bottom (should have probably to add a back arrow)

- create views to hold the content (as xib)

- when moving to next or previous page, load the appropriate view (would have a property that stores which is the present view on display)

Replies

Looks like you don't want the pageView behavior.


A possibility here would be either:

- just use a navigation controller

or even,

- keep a simple ViewController with the button at bottom (should have probably to add a back arrow)

- create views to hold the content (as xib)

- when moving to next or previous page, load the appropriate view (would have a property that stores which is the present view on display)