I have two UITextFields (e.g. username and password) but I cannot get rid of the keyboard when pressing the return key on the keyboard. How can I do this?
UITextFields
in swift you should delegate UITextfieldDelegate, its important don't forget it, in the viewController, like:
class MyViewController: UITextfieldDelegate{ mytextfield.delegate = self func textFieldShouldReturn(textField: UITextField) -> Bool { textField.resignFirstResponder() } }