0

As the title, how to make a UILabel or UITextField long press can be copy, but not edit?

I show the pic:

This is the copy state

I have tested the UITextField, even so long press it can make it be copy, but it also can be edit, such as delete some words, or can add some words, which is not required.

Quango
  • 12,338
  • 6
  • 48
  • 83
samoye
  • 73
  • 1
  • 10

1 Answers1

0

Here is what I found for UILabel: https://github.com/alexandreos/UILabel-Copyable

install via cocoapods: pod 'UILabel+Copyable', '~> 1.0.1'

Intel
  • 141
  • 1
  • 9
  • you see my question have cursor,can choose words. – samoye Jan 12 '17 at 00:34
  • check this out:[Enable copy and paste on UITextField without making it editable](http://stackoverflow.com/questions/1920541/enable-copy-and-paste-on-uitextfield-without-making-it-editable) and this [How to disable UITextField editing but still accept touch?](http://stackoverflow.com/questions/9116969/how-to-disable-uitextfield-editing-but-still-accept-touch) – Intel Jan 19 '17 at 09:50