After overriding textField(shouldChangeCharactersIn) to something like this:
textField(shouldChangeCharactersIn)
func textField(_ textField: UITextField, shouldChangeCharactersIn r