In iOS,
I have a image.
Then, I want to make transparent area in specific path of the image.
The below image is some image. And, the heart area is random path to be transparent area.
I have just one full image.
I want to make transparent specific area of image. It is UIImage, not UIImageView. So, I can't use masking.
https://stackoverflow.com/a/8306254/2160799
I tried to use this solution, but the heart area was filled with blue color, not transparent. :(
The document explain like this. Because the solution uses imageContext(not window or bitmap contexts), I should not use the function(CGContext.clear(_:))
If the provided context is a window or bitmap context, Core Graphics clears the rectangle. For other context types, Core Graphics fills the rectangle in a device-dependent manner. However, you should not use this function in contexts other than window or bitmap contexts.