Monday, May 21, 2012

UIWebView copy/paste

Hy.
I have a single view application that only contains a web view and a text field which acts like an address bar. After selecting part of a web page, i want to push a button to copy it(all of the selection including text and pictures) and automatically paste it into another view.
I can add a button to the edit menu (although i don't know how to remove the copy and paste buttons), but i don't know how to get the selection.



I have tried to use gesture recognizers to do this but i cannot find a way to get the selection. I set my view controller as a UIWebViewDelegate and an UIGestureRecognizerDelegate and tried to implement touchesBegan, touchesMoved and touchesEnded, but they don't get called when starting selection. Do you know an example with something like this or at least point me in the good direction? Thank you!





No comments:

Post a Comment