swift - Select all text in a UITextField -


how programatically select text in swift text field?

like safari

enter image description here

i try this:

textfield.becomefirstresponder()  textfield.selectedtextrange = textfield.textrange(from: textfield.beginningofdocument, to: textfield.endofdocument) 

or this:

textfield.selectall(self) 

but not effect want.

if aim select text in uitextfield, use this:

textfield.selectall(nil) 

Comments

Popular posts from this blog

Sort a complex associative array in PHP -

vb.net - How to ignore if a cell is empty nothing -

recursion - Can every recursive algorithm be improved with dynamic programming? -