I ran into this problem too, and I think @Lukas Kukacka's answer is a great solution. I would like to add a little more to this solution, and I recommend using a category for it. Why a category? Because in my case, I use this "method" in several classes, so instead of writing the same code several times, I will do it only once.
Let's see the code: It will be UIImage + OverlayTintColor.h
This will be UIImage + OverlayTintColor.m
#import "UIImage+OverlayTintColor.h" @implementation UIImage (OverlayTintColor) - (UIImage *)overlayTintColor:(UIColor *)tintColor{
Usage: (Remember to import the category at the top of the class where you intend to use it)
#import "UIImage+OverlayTintColor.h" ....... UIImage *image=[[UIImage imageNamed:@"test.png"] overlayTintColor:[UIColor blueColor]];
source share