Try it.
ColorChangingImageView.h
ColorChangingImageView.m
Then, to use it:
ColorChangingImageView *iv = [[ColorChangingImageView alloc] initWithFrame:rect]; [iv setBackgroundColor:[UIColor clearColor]]; // might not need this, not sure. [iv setImage:[UIImage imageNamed:@"image.png"]]; [iv setColorToChangeInto:[UIColor blueColor]];
... or at least something very close to that. Let me know if this works for you.
You can also play with the second parameter CGContextSetBlendMode() for slightly different effects.
source share