Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@DaveBatton
Last active January 4, 2016 01:29
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 DaveBatton/8548872 to your computer and use it in GitHub Desktop.
Save DaveBatton/8548872 to your computer and use it in GitHub Desktop.
Sets the backgroundColor of the specified view and all of its subviews. A tool to help debug iOS UI issues.
- (void)colorizeView:(UIView *)view
{
static CGFloat alpha = 0.1f;
view.backgroundColor = [[UIColor blueColor] colorWithAlphaComponent:alpha];
alpha += 0.1f;
for (UIView *subview in view.subviews) {
[self colorizeView:subview];
}
alpha -= 0.1f;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment