I have a app in which I have a PageViewController that shows it’s pages on after another without the user doing anything. I want to totally block the user’s acces. I have a back button that appears on the top after all of pages have been shown. But if I try to tap it … it starts going through the pages again (it’s in the area that you would usually tap to go to previous page).
So, does anyone have any idea how could I “remove” the gesture recognizers ?
I tried commenting the line :
self.view.gestureRecognizers = self.pageViewController.gestureRecognizers;
from RootViewController but it didn’t work.
I haven’t tried this myself, and it probably won’t be the solution for everyone, but for your particular case because you’re manually changing all the pages it should work. I found the following tid-bit in the UIPageViewController documentation in the Overview section.
You will still want to comment out the line that you mentioned above, but also
self.pageViewController.dataSource = self.modelController;EDIT: Just tested this myself and it works. Can’t navigate with any of the gestures, but can programmatically.