Format UITextField text without having cursor move to the end
I am trying to apply NSAttributedString styles to a UITextField after processing a new text entry, keystroke by keystroke. The problem is that any time I replace the text the cursor will jump the very end on each change. Here's my current approach … Receive and display text change immediately (same issue applies when I return false and do the text replacement manually) func textField(textField: UITextField!, shouldChangeCharactersInRange range: NSRange, replacementString string: String!) -> Bool { let range:NSRange = NSRange(location: range.location, length: range.length) let newString =