I want to put cursor (indicator point) to the end of text field.
I have the following code, but it does nothing
textField.selectedTextRange = textField.textRange(from: textField.endOfDocument, to: textField.endOfDocument)
func textFieldDidBeginEditing(_ textField: UITextField) {
NotificationCenter.default.post(name: NSNotification.Name(rawValue: "selection_sub"), object: nil)
imitateSingleSelection()
textField.text = textField.text?.toLocalNumberFormatFromServer()
textField.selectedTextRange = textField.textRange(from: textField.endOfDocument, to: textField.endOfDocument)
}
Is there a way to put cursor to the end of text field?