I have an app in which the user has to type a four digit pin code. All digits have to be at a set distance from each other.
Is there a way to do this if the PinTextField
is a subclass of UIView
? I know in a ViewController
you could use UITextFieldTextDidChangeNotification
and set the attributed text for each change. Notifications don't seem to work in a UIView
though.
Also I was wondering if there isn't a simpler way than making an attributed string for every update if you want to set the letter spacing of a UITextField
text ?
Correct spacing:
Wrong spacing: