hide keyboard

The best answer I found was the following:

and then create the IBOutlet for your text field like this

make sure that it is connected to your text field on your view in storyboard.

finally set its Delegate using

We are almost done. Now place this delegate function into your class.

 

 

 

Right here: https://stackoverflow.com/questions/24908966/hide-keyboard-for-text-field-in-swift-programming-language