Alright, I have a couple of UITextFields and UITextViews inside a UIScrollView, and I\'d like to set the keyboard to disappear wheneve
Although the essence is the same, I prefer less code.
Setting the keyboard to disappear when the scrollView is scrolled in Attributes inspector:

Then disappear keyboard when scrollView is tapped:


scrollView.endEditing(true). If you are using Objective-C, [self.scrollView endEditing: YES];