Created
January 7, 2020 15:44
-
-
Save PetreVane/c8bda678f2fceff26600f8fa1f224a79 to your computer and use it in GitHub Desktop.
This methods adds a gesture recognizer on your current view, which dissmises the keyboard when tapped away
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func dismissKeyboardGesture() { | |
let tapGesture = UITapGestureRecognizer(target: self.view, action: #selector(UIView.endEditing(_:))) | |
view.addGestureRecognizer(tapGesture) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment