How can I dismiss the keyboard when a button is pressed, programmatically with swift?
Setting the UITextfield delegate programmatically swift 2.2 Add UITextFieldDelegate in your class.
https://stackoverflow.com/a/31689406/5576747