Skip to content

Instantly share code, notes, and snippets.

@Akhrameev
Last active March 24, 2016 10:40
Show Gist options
  • Save Akhrameev/117b02ef07881df7cdf8 to your computer and use it in GitHub Desktop.
Save Akhrameev/117b02ef07881df7cdf8 to your computer and use it in GitHub Desktop.
- (UIView *) huntedSubviewWithClassName: (NSString *) className
{
if ([[[self class] description] isEqualToString: className])
{
return self;
}
for (UIView *subview in self.subviews)
{
UIView *huntedSubview = [subview huntedSubviewWithClassName: className];
if (huntedSubview != nil)
{
return huntedSubview;
}
}
return nil;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment