Skip to content

Instantly share code, notes, and snippets.

@KatagiriSo
Created December 28, 2011 01:12
Show Gist options
  • Save KatagiriSo/1525690 to your computer and use it in GitHub Desktop.
Save KatagiriSo/1525690 to your computer and use it in GitHub Desktop.
setColor
- (void)setColor:(UIView *)v
{
static int i = 0;
NSArray* colors = [NSArray arrayWithObjects:[UIColor redColor],[UIColor blueColor],[UIColor yellowColor],[UIColor greenColor],[UIColor purpleColor],[UIColor blackColor],[UIColor lightGrayColor],nil];
[v setBackgroundColor:[colors objectAtIndex:i]];
i++;
if (i>= [colors count]) {
i = 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment