So I have a UITextView that I\'m using to allow the user to submit some text.
My problem is, I can\'t seem to figure out how to allow the user to \'Cancel\' by tappi
Here is a better solution that does not depend upon an outlet and is going to work with any number of UITextField objects in your controller.
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
if (![[touch view] isKindOfClass:[UITextField class]]) {
[self.view endEditing:YES];
}
[super touchesBegan:touches withEvent:event];
}