Skip to content

Instantly share code, notes, and snippets.

@kespindler
Created November 28, 2011 19:04
Show Gist options
  • Save kespindler/1401553 to your computer and use it in GitHub Desktop.
Save kespindler/1401553 to your computer and use it in GitHub Desktop.
Find the tags that are used in a view hierarchy so you don't interfere with existing tags!
- (NSMutableSet *)recurIntoView:(UIView *)v {
NSMutableSet *s = [NSMutableSet set];
for (UIView *sv in v.subviews) {
[s addObject:[NSNumber numberWithInt:sv.tag]];
[s unionSet:[self recurIntoView:sv]];
}
return s;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment