I\'d like to know the simplest code to dismiss the number pad keyboard when tapping anywhere outside the number pad. It\'s a simple application to input a number inside a te
Lots of answers here but still had to struggle to figure it out using XCode 5. Read this: https://developer.apple.com/library/ios/documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/GestureRecognizer_basics/GestureRecognizer_basics.html
Add a Tap Gesture Recognizer to your UIScrollView. Set its delegate to be the viewcontroller.
Add this method:
- (IBAction)tappedSomewhere:(id)sender {
[self.view endEditing:YES];
}
to your UIScrollView implementation code and associate it to the Tap Gesture Recognizer by control click and dragging to the implementation code.
Worked for me.