Created
June 17, 2014 08:18
-
-
Save vpdn/65300ab4314179f6935f to your computer and use it in GitHub Desktop.
First responder
This file contains hidden or 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
static __weak id currentFirstResponder; | |
@implementation UIResponder (FirstResponder) | |
+(id)currentFirstResponder { | |
currentFirstResponder = nil; | |
[[UIApplication sharedApplication] sendAction:@selector(findFirstResponder:) to:nil from:nil forEvent:nil]; | |
return currentFirstResponder; | |
} | |
-(void)findFirstResponder:(id)sender { | |
currentFirstResponder = self; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment