Skip to content

Instantly share code, notes, and snippets.

@MaximAlien
Created January 13, 2016 12:09
Show Gist options
  • Save MaximAlien/83fbcb046293cee9732a to your computer and use it in GitHub Desktop.
Save MaximAlien/83fbcb046293cee9732a to your computer and use it in GitHub Desktop.
[iOS] Code which controls UIImage colour by changing tint colour of the UIButton.
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 15, 15)];
UIImage *image = [[UIImage imageNamed:@"image_res"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
[button setImage:image forState:UIControlStateNormal];
[button setTintColor:[UIColor whiteColor]];
[self addSubview:button];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment