I have a UITextField that has a target added which performs checks on the field as the user is typing. I currently have an issue however when my code adds text to the textfield in that the text doesn't get checked. Is there a way I can solve this through .editingChanged or is there another UIControlEvent to hook into?
Code is:
NumberOutlet.addTarget(self, action: #selector(handleNumberImage), for: .editingChanged)
The way you can handle this is by implementing the
UITextViewDelegateprotocol in your viewcontroller. In yourviewDidLoadyou would want to set the delegate of yourUITextFieldtoself.Then, simply implement the following method, like demonstrated here: