uias / Pageboy

📖 A simple, highly informative page view controller
MIT License
1.99k stars 155 forks source link

shouldScrollAtPage request #105

Closed rursache closed 7 years ago

rursache commented 7 years ago

hello, i am trying to only let the user scroll to the next pages if they fill some data in each page. i also want to only let them go back if they change their minds but they cannot continue until something is filled in the current page. how can i achieve this?

haarismuneer commented 7 years ago

You could set isScrollEnabled to false by default. Then you could check to see if all the data is filled in, and if it is, set isScrollEnabled to true.

rursache commented 7 years ago

yes, i'm already doing that. but that locks the scroll in both directions, i wanna lock only the scroll to right while scrolling to left to be functional

msaps commented 7 years ago

@iPhoNewsRO just had a quick look at if there was anything I could do in regards to direction locking, and unfortunately it looks like it won't be possible due to the weird stuff that UIPageViewController does with it's underlying UIScrollView.

It appears that isDirectionLockEnabled has no effect, and manually changing contentOffset doesn't work due to the VC reuse management from what I can tell.

😢

rursache commented 7 years ago

thanks for the research, hopefully we could find something in the future