add this function:
func textFieldShouldReturn(textField: UITextField!) -> Bool {
textField.resignFirstResponder()
return true
}
After the result gets to each text field, the keyboard resigns. You can add tags to your text fields and then add if / else statements for different types of behavior, depending on which text textField.tag responded if you want.
, IBOutlet .