Skip to content

Instantly share code, notes, and snippets.

@meyusufdemirci
Last active August 1, 2018 22:23
Show Gist options
  • Save meyusufdemirci/022077b20f1d239f219fa9085c11e497 to your computer and use it in GitHub Desktop.
Save meyusufdemirci/022077b20f1d239f219fa9085c11e497 to your computer and use it in GitHub Desktop.
override func viewDidLoad() {
super.viewDidLoad()
let tap = UITapGestureRecognizer(target: self, action: #selector(dismissKeyboard))
tap.cancelsTouchesInView = false
view.addGestureRecognizer(tap)
}
@objc func dismissKeyboard() {
view.endEditing(true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment