0

I want to use a UITextField so that only part of it will be editable.

I know about the delegation and shouldChangeCharactersInRange but for some reason, copying the ranged part is allowed.

My goal is to get similar result to this (the 'subject' text part) without being able to copy it.

Should i use a different UITextField with textFieldDidBeginEditing returning false all the time?

Is there a better solution?

Itzik984
  • 15,968
  • 28
  • 69
  • 107
  • You refer to the screenshot. That seems to be either a placeholder or a label next to the UITextField. –  Jun 17 '15 at 21:00
  • It's not a place holder, its the regular mail 'Subject' label. So an extra field is the best practice for this one? – Itzik984 Jun 17 '15 at 21:02
  • An extra UILabel, yes. This way you can style it to your liking as well. –  Jun 17 '15 at 21:03
  • If you want to disable copy & paste actions, you could try to implement one of the answers to [this question](http://stackoverflow.com/questions/1426731/how-disable-copy-cut-select-select-all-in-uitextview). – Glorfindel Jun 17 '15 at 21:09

1 Answers1

0

In the screenshot, a UILabel placed next to the UITextField is used. I'd recommend doing this as it will give you more options when you decide to style the text.