Created
June 4, 2011 23:07
-
-
Save dlinsin/1008470 to your computer and use it in GitHub Desktop.
FindAndResignFirstResponder Category
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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