Skip to content

Instantly share code, notes, and snippets.

@dlinsin
Created June 4, 2011 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dlinsin/1008470 to your computer and use it in GitHub Desktop.
Save dlinsin/1008470 to your computer and use it in GitHub Desktop.
FindAndResignFirstResponder Category
@implementation UIView (FindAndResignFirstResponder)
- (BOOL)findAndResignFirstResponder
{
if (self.isFirstResponder) {
[self resignFirstResponder];
return YES;
}
for (UIView *subView in self.subviews) {
if ([subView findAndResignFirstResponder])
return YES;
}
return NO;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment