Skip to content

Instantly share code, notes, and snippets.

@tungpt247
Last active August 29, 2016 02:04
Show Gist options
  • Save tungpt247/eb96c218960aed1c03a9 to your computer and use it in GitHub Desktop.
Save tungpt247/eb96c218960aed1c03a9 to your computer and use it in GitHub Desktop.
Diss miss keyboard when tab on view
// tap anywhere on the view
var viewTab = UITapGestureRecognizer(target: self, action: "dismissKeyboard")
view.addGestureRecognizer(viewTab)
func dismissKeyboard() {
view.endEditing(true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment