Skip to content

Instantly share code, notes, and snippets.

@AlexandrFadeev
Last active November 22, 2017 10:07
Show Gist options
  • Save AlexandrFadeev/94f6d851352660b196a2c09c56ad3929 to your computer and use it in GitHub Desktop.
Save AlexandrFadeev/94f6d851352660b196a2c09c56ad3929 to your computer and use it in GitHub Desktop.
snippet for UITextFieldDelegate textField shouldChangeChaactersInRange...
func textField(textField: UITextField!, shouldChangeCharactersInRange range: NSRange, replacementString string: String!) -> Bool {
if let text = textField.text as NSString? {
let txtAfterUpdate = text.replacingCharacters(in: range, with: string)
self.callMyMethod(txtAfterUpdate)
}
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment