//Hide Keyboard //1) Add DismissKeyboard function to resign keyboard on all textboxes func DismissKeyboard(){ //forces resign first responder and hides keyboard // put all UItextFields [UItextfield].endEditing(true) } //2) Add touchesBegan function to catch screen tap and resign keyboard //hide keyboard override func touchesBegan(touches: Set, withEvent event: UIEvent?) { //forces resign first responder and hides keyboard DismissKeyboard() } //3) Put in ViewDidLoad //Looks for single or multiple taps //Replace "ViewController" with the name of ViewController let tap:UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(ViewController.DismissKeyboard)) //Adds tap gesture to view view.addGestureRecognizer(tap) //4) Add textFieldShouldReturn function. This is called when 'return' key pressed on any UITextField. return NO to ignore. func textFieldShouldReturn(textField: UITextField!) -> Bool { textField.resignFirstResponder() return true; } //5) Add Delegate to UITextFields to ViewController ([CNTRL] + Drag textfields to yellow viewcontroller and select delegate)