Last active
August 29, 2015 13:58
-
-
Save looping/10115779 to your computer and use it in GitHub Desktop.
- (id)fromViews:(NSArray *)views findViewWithClass:(Class)viewClass;
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
- (id)fromViews:(NSArray *)views findViewWithClass:(Class)viewClass { | |
id retView = nil; | |
for (UIView * subView in views) { | |
if ([subView isKindOfClass:[UIAlertView class]]) { | |
retView = subView; | |
break; | |
} else { | |
if ([subView.subviews count]) { | |
retView = [self fromViews:subView.subviews findViewWithClass:viewClass]; | |
} | |
} | |
} | |
return retView; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment