0

In my custom UITextField the user can place an e-mail by touching on "+" button or by writing it from keyboard. The problem is when the e-mail is added through "+" button and then, someone wants to add another e-mail, this time by writing it from keyboard, the cursor instead of being at the end of the text, highlights previously written mails, but it cannot be placed at the end of the text - which is what I would like. I hope what I wrote is understandable. Anyways, do you know a way of implementing this?

I've already tried setting keyboard time and selecting text range but it brought me no good

rmaddy
  • 314,917
  • 42
  • 532
  • 579
aleksy.t
  • 267
  • 2
  • 18
  • Have you seen this? https://stackoverflow.com/questions/34922331/getting-and-setting-cursor-position-of-uitextfield-and-uitextview-in-swift – Markicevic Jan 18 '19 at 14:12
  • Yes, I've seen this but this doesn't work for me. It often happens that if there are let's say 4 mails in the textField, which were added by "+" and then, one touches on the textField, it often happens that the text selected is of one the mails and I simply cannot put the cursor at the end to add something from keyboard. I just don't want that e-mail highlighting whenever textField is touched and normal writing style – aleksy.t Jan 18 '19 at 14:26
  • Maybe try to set that textfield do not recognize email, to just look at it as plain text. I think you can find that in IB. – Markicevic Jan 18 '19 at 14:38
  • Edit your question, post the code you have tried and the issues you are facing – Leo Dabus Jan 18 '19 at 18:21

0 Answers0