В Быстрых 4 или 5 можно использовать как..
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
//Key borad dismiss
let tap: UITapGestureRecognizer = UITapGestureRecognizer(target: self, action: "dismissKeyboard")
tap.cancelsTouchesInView = false
view.addGestureRecognizer(tap)
}
//Key board hide on outside the textfield
@objc func dismissKeyboard() {
//Causes the view (or one of its embedded text fields) to resign the first responder status.
view.endEditing(true)
}
}