caipivara
11/23/2014 - 8:48 PM

Hide Keyboard Swift iOS

Hide Keyboard Swift iOS

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
    }
    
}