copy text from textfield with not enabling keyboard
i have a uitextfield and some text on it, i 开发者_如何学运维want to know how to create a code that my user touch the field and can copy the txt to use for something else. my uitextfiled.enable = no; thanks
As far as the copying goes, you need to check out the UIPasteboard Class. Using that class, you can put text onto the pasteboard very easily.
For not enabling the text field, you can simply leave it disabled, but capture the touch event anyway.
For the pasteboard, try going through this tutorial.
I you are able to use UITextField
class instead you could set the editable
property to NO
. Selecting text will still be possible.
精彩评论