Jul 22, 2017 · 1 min read
With Swift 3.0 you can do something like:
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {self.view.endEditing(true)}
in your view controller you wish to have this behavior on. It also works “through” other views, such as tapping on a label that’s in your view.
