Skip to content

Instantly share code, notes, and snippets.

@danielgomezrico
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danielgomezrico/4999352d87eb670e6659 to your computer and use it in GitHub Desktop.
Save danielgomezrico/4999352d87eb670e6659 to your computer and use it in GitHub Desktop.
Hide Keyboard Swift iOS
class .. : UITextFieldDelegate{
// MARK: - Hide Keyboard
public override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) {
self.view.endEditing(true)
}
public func textFieldShouldReturn(textField: UITextField) -> Bool {
textField.resignFirstResponder()
return true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment