Skip to content

Instantly share code, notes, and snippets.

@jweinberg
Created July 4, 2011 03:39
Show Gist options
  • Save jweinberg/1062884 to your computer and use it in GitHub Desktop.
Save jweinberg/1062884 to your computer and use it in GitHub Desktop.
@implementation UIView (Responder)
- (UIView *)currentFirstResponder;
{
for (UIView *view in [self subviews])
{
if ([view isFirstResponder])
return view;
if (![view isKindOfClass:[UIControl class]])
{
UIView *subview = [view currentFirstResponder];
if (subview)
return subview;
}
}
return nil;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment