Enable copy and paste on UITextField without making it editable

后端 未结 6 2021
孤街浪徒
孤街浪徒 2020-11-27 17:54

I want the text in a UITextField (or ideally, a UILabel) to be non-editable, but at the same time give the user the ability to cop

6条回答
  •  猫巷女王i
    2020-11-27 18:24

    Try UITextView instead (I suspect it would work like a UILabel for you). I tested this with its editable property set to NO, and double-tapping-to-copy worked for me.

提交回复
热议问题