Trying to do some work with text selected in a UIWebView. There are 2 buttons that pop over:
Copy and Define

At a very high level, how can I do the following?
1) Grab the value of the text selected
2) Add another menu item
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The
UIMenuControllersingleton is the black popup with the buttons, and the documentation has good information on how to work with that (presenting it manually, adding new items, responding to actions, etc).As for getting the selected text, I see you’re using an editable div in a
UIWebView, which means you have to respond to editing actions via JavaScript.