Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to implement copy and paste functionality in iOS [closed]

I am developing an app for iOS > 4.3.

I am looking for best practices regarding coping and pasting text between views or applications.

like image 855
cateof Avatar asked Feb 19 '26 21:02

cateof


1 Answers

You could use UIPasteboard,

while setting:

   UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
   [pasteboard setString:yourtext];

while getting (if you have a label):

   UIPasteboard *pasteboard = [UIPasteboard generalPasteboard];
   pastelabel.text =  [pasteboard string];

and you can refer Pasteboard Programming Guide for more details.

like image 188
Charan Avatar answered Feb 21 '26 09:02

Charan



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!