baker icon indicating copy to clipboard operation
baker copied to clipboard

Prevent page change for concrete pages

Open isaacsf opened this issue 13 years ago • 5 comments

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

isaacsf avatar Apr 29 '13 19:04 isaacsf

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...).

folletto avatar Apr 29 '13 19:04 folletto

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 avatar Apr 30 '13 07:04 isaacsf

@isaacsf have you found a solution for this?

Simbul avatar May 20 '13 21:05 Simbul

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 .

isaacsf avatar May 21 '13 06:05 isaacsf

Try having a look at the gotoPage function in BakerViewController.m, as all page changes should go through that.

Simbul avatar Jun 03 '13 21:06 Simbul