Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting selected text from UIMenuController

Tags:

ios

iphone

ipad

I'm trying to get the selected text when performing actions with a UIMenuController. How do I get the selected text out? I'm using a UIWebView at the moment, but would like a universal solution if there is one.

like image 925
codeetcetera Avatar asked Jan 22 '26 03:01

codeetcetera


1 Answers

You should be able to get the data from UIPasteboard. It should be something like [UIPasteboard generalPasteboard].string for text.

like image 148
Deepak Danduprolu Avatar answered Jan 24 '26 21:01

Deepak Danduprolu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!