You need to set your text field current editor selected range property. Try like this:
textField.currentEditor()?.selectedRange = NSRange(location: 4, length: 0)
You will need to call displayIfNeeded
textField.displayIfNeeded()
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…