Skip to content

Instantly share code, notes, and snippets.

@chrisbrandow
Created October 4, 2014 05:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chrisbrandow/790cf841d40afc6488bb to your computer and use it in GitHub Desktop.
Save chrisbrandow/790cf841d40afc6488bb to your computer and use it in GitHub Desktop.
a recursive method for identifying the UITableViewCell that contains a particular UIView or UIView subclass (i.e. UIControl) object in its view hierarchy.
- (UITableViewCell *)cellContainingView:(UIView *)view {
return (!view || [view isKindOfClass:[UITableViewCell class]]) ? (UITableViewCell *)view : [self cellContainingView:view.superview];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment