After hopelessly looking for a solution to allowing the user to select text and getting the selection from a UIWebView (without having the built-in popover appear), I was wondering if you were able to resolve this? I have tried many of the techniques suggested (subclass, transparent view, subclass of UIWindow, etc.), but even if I can obtain touch events, I have yet to actually resolve turning that touch point into drawing and obtaining the underlying html selection.
It would be wonderful if the next SDK would allow a delegate for the popover when text is selected so a custom menu for the selection can be provided and javascript injected to do something useful. Ideally, I would want to:
1) receive notification from the UIWebView that text was selected and what that text was.
2) allow me to display my own popover above that selected text
3) handle the popover selection and inject javascript back into the IUWebView to do stuff like highlight text etc.
Quote:
Originally Posted by lepetitapps
You might want to look into one of two things. The first is the webView method stringByEvaluatingJavaScriptFromString:
This allows you to pull JavaScript values out of the web view and into the rest of your app
The other is maybe look at the pasteboard api, see if there is anything there that can help
|