Skip to content Skip to sidebar Skip to footer

Text Highlighting And Add Notes Function In Epub Reader Ios

I am developing epub reader for ios and android. I want to implement text highlights and add note function to my epub reader. And I want to know how to these functionality for fixe

Solution 1:

I have implemented all these for native epub player of androd and iOS- its a product R&D for an organisation

Instead of using getSelection follow the below steps.Its tedious but functionality would be fully under your control

-> Give url to UIWebView (iOS) or WebView (android) -> in call back of webview didload - wrap all text words into spans with unique ids -> propagate touch events to webview- javascript will handle those touches using function onTouchMove(e) -> get touched span using document.elementFromPoint -> highlight those spans (words) -> You will get position of each span $('#wordID-'+sWordID).position(),you can pass those values from javascript to native code -> Add sticky notes view to the super view of webview

Note: better inject jQuery in run time into webview for wrapping words into spans

Post a Comment for "Text Highlighting And Add Notes Function In Epub Reader Ios"