How to hide keyboard in Swift 5 (Without any third party library)

Описание к видео How to hide keyboard in Swift 5 (Without any third party library)

I considered listing every method there is to disable the iOS app's keyboard and letting developers choose the most appropriate one.

UITextFields' keyboard appears as soon as you start editing; it is one of the first responders. It is up to the developer to write the code to ignore it.
I'll try to illustrate a few different approaches, especially if your view controller has several UITextFields.

UITextFieldDelegate’s textFieldShouldReturn method
UIToolbar (When there is no return button)
UITapGestureRecognizer
Keyboard dismiss mode of UIScrollview
TouchesBegan function of viewController

*Please suggest if you have any more ways to do this.

Комментарии

Информация по комментариям в разработке