What I've been trying to achieve for a couple of hours is something like the following:
I would like to have a UIImage
in the background and then preferably a UIView
with a background color of red with some kind of multiply effect (the red area). Is this possible? I've seen a few extensions for UIImage that tints them, but that would only work if I wanted my WHOLE image to have a red multiply color effect.
Thanks
You could just add a red
UIView
to the top of yourUIImageView
. Adjust the alpha to make it transparent:Using a multiply instead:
With iOS10 you can now use
UIGraphicsImageRenderer
to add a partial multiply effect as easy as this:You can then use it like this to multiply the lower third of the original with a red multiply:
Which results in this:
Swift 3 Extension (thx to @Kex):
Example: