Prevent page change for concrete pages
Hi all,
I've been looking for this issue with no success or answer that helps me.
I would like to prevent page change for one or more pages using the page swipe function. I know that property "-baker-page-turn-swipe" exists, but I don't want to change it for all pages, only for a list I have.
Using JS I know I can capture "swipe" events, but the problem is that before it fires the user can swipe the page.
I've been looking into the Baker Xcode project, but I'm not able to find any solution.
Any help or ideas?
Thank you in advance.
Isaac
It requires a change in the code. The swipe is automatically provided by a native iOS componente, UIScrollView and as such you should add some code to enable and disable it when you need it.
As a direction on what to change, you might look to modify the property self.scrollView.scrollEnabled, disabling it when you land on the page you don't want to scroll from, and enabling it on all the other pages.
I'm not sure what you're trying to achieve tho... because if this is a magazine, users expect to scroll in that way, or by tapping on the side of the page (you might want to disable that too I guess...).
Thank you @folletto for your answer.
What I'm looking for is to lock swipe for that pages that have high interaction on it (i.e. draggable objects). In that cases, the swipe function in not suitable, furthermore if the main users are children :-)
Do you know all functions/events that control the landing inside a page?
I have coded scrollViewDidEndDecelerating to change scrollView.scrollEnabled, but this event is not fired when I access the book directly in that locked page.
My idea is to fill an array of locked pages, similar that the contents parameter we have in book.json file.
Any help will be appreciated.
Best regards,
@isaacsf have you found a solution for this?
No, I didn't go deeper on this, because of my ignorance with the Baker code.
If you could guide me on the events that generate the page change, maybe we can find a solution applicable for everybody.
Thanks,
On Mon, May 20, 2013 at 11:45 PM, Alessandro Morandi < [email protected]> wrote:
@isaacsf https://github.com/isaacsf have you found a solution for this?
— Reply to this email directly or view it on GitHubhttps://github.com/Simbul/baker/issues/857#issuecomment-18176091 .
Try having a look at the gotoPage function in BakerViewController.m, as all page changes should go through that.