readium / SDKLauncher-iOS

A small iOS application to serve as a launcher/testbed for the Readium SDK.
BSD 3-Clause "New" or "Revised" License
71 stars 47 forks source link

Swipe Navigation #89

Closed sage-IT closed 7 years ago

sage-IT commented 7 years ago

Hey guys,

Since this isnt officially supported yet i thought I'd ask if there is a branch for the ReadiumSDK launcher for IOS that implements swipe navigation. Ive been looking through the code and I cant seem to find where the navigation is controlled. I know there is a UINavigation controller in there somewhere I think if I find where that code is located I can get started on implementing swipe navigation.

Cheers

Update: EpubViewController.m has the controls for the navigation. The functions invoke a javascript that utilises: @"ReadiumSDK.reader.openPageNext()" and @"ReadiumSDK.reader.openPagePrev()". Im gonna first try and add a swift controller for the swipe navigation.

danielweck commented 7 years ago

Yes, that's the way to go: add your touch gesture handler (swipe action), and bind to existing command via the Javascript "bridge".

danielweck commented 7 years ago

You will probably have to handle touch conflicts with interactive items in EPUB content, such as audio/video time bars, widgets, etc. Swipe control was implemented using Hammer.js in the cloud reader and the Chrome app, but subsequently removed as the user experience wasn't fully satisfactory. Native apps have to deal with UX issues on a per-platform basis. Unfortunately there is no adequate cross-platform solution.

sage-IT commented 7 years ago

Yay I did it!!! It seems to be working 90% of the time but in 1/10 tests i somehow downloaded one of the readium java script pages and opend safari :/.. I cant emulate this problem though. Let me know if you would like me to create a branch. I only modified one file and added a -(void) viewDidLoad function to that file with the swipe gesture functions as well. Its seems to handle bounds checking fine too.

danielweck commented 7 years ago

feel free to create a pull request against the development branch.