Skip to content

Instantly share code, notes, and snippets.

@engmsaleh
Last active December 23, 2015 13:19
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 engmsaleh/ede0a358dcdd3c209497 to your computer and use it in GitHub Desktop.
Save engmsaleh/ede0a358dcdd3c209497 to your computer and use it in GitHub Desktop.
Apply tint color on UIImage inside UIImageView
// Source http://mikethinkingoutloud.com/color-a-uiimage/
// init the image using imageWithRenderingMode set to AlwaysTemplate
UIImage *image = [[UIImage imageNamed:@"checkmark"]
imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
// put UIImage in a UIImageView and adjust color with tintColor
UIImageView *imageView = [[UIImageView alloc]initWithImage:image];
imageView.tintColor = [UIColor redColor];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment