Last active
June 28, 2017 20:58
-
-
Save ericjames/1f616c4e4573507f454b671fa57fba98 to your computer and use it in GitHub Desktop.
This file contains 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
@IBOutlet weak var myTextField: UITextField! | |
// Dismisses keyboard by touching outside of keyboard | |
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) { | |
// Dismiss keyboard | |
self.view.endEditing(true) | |
} | |
func textFieldShouldReturn(_ textField: UITextField) -> Bool { | |
myTextField.resignFirstResponder() | |
return true | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment