Last active
December 23, 2015 13:19
-
-
Save engmsaleh/ede0a358dcdd3c209497 to your computer and use it in GitHub Desktop.
Apply tint color on UIImage inside UIImageView
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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