Last active
August 29, 2015 14:10
-
-
Save danielgomezrico/4999352d87eb670e6659 to your computer and use it in GitHub Desktop.
Hide Keyboard Swift iOS
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
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