Created
November 8, 2013 06:53
-
-
Save flashlib/7367222 to your computer and use it in GitHub Desktop.
查找当前处于激活编辑状态的视图
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
@implementation UIView (FindFirstResponder) | |
- (UIView *)findFirstResponder | |
{ | |
if (self.isFirstResponder) { | |
return self; | |
} | |
for (UIView *subView in self.subviews) { | |
UIView *firstResponder = [subView findFirstResponder]; | |
if (firstResponder != nil) { | |
return firstResponder; | |
} | |
} | |
return nil; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment