Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Copy Text to Clipboard (Pasteboard) from UITextView via UIButton?

Is there any way to copy text from a TextView that has User Interaction is enabled to the clipboard via a UIButton?

But instead of the user holding down his finger on the uitextview so that the apple standard window popups to copy I want the user to be able to do with just the click of the button .. (Whole text)

Regards,

like image 791
Omkar Jadhav Avatar asked Mar 26 '10 10:03

Omkar Jadhav


1 Answers

In the button's target action, call

[UIPasteboard generalPasteboard].string = uiTextView.text;
like image 107
kennytm Avatar answered Sep 23 '22 19:09

kennytm