How can I dismiss the keyboard when a button is pressed, programmatically with swift?
you have to call resignFirstResponder on currently active UI Element (most likely, UITextField).
resignFirstResponder
UITextField