Skip to content

Instantly share code, notes, and snippets.

@taberh
Created April 15, 2012 03:08
Show Gist options
  • Save taberh/2389665 to your computer and use it in GitHub Desktop.
Save taberh/2389665 to your computer and use it in GitHub Desktop.
find view with view name
-(UIView *)findView:(UIView *)view withName:(NSString *)name{
Class cl = [view class];
NSString *desc = [cl description];
if ([desc compare:name] == NSOrderedSame)
return view;
for (int i = 0; i < [view.subviews count]; i++)
{
UIView *subView = [view.subviews objectAtIndex:i];
subView = [self findView:subView withName:name];
if (subView) return subView;
}
return nil;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment