Don't draw a colour or a pattern into the path, draw transparency. You need one image in its own layer behind the image that is being wiped out. Create the path as you are now, but instead of setting the colour, set the blend mode to clear (kCGBlendModeClear
).
This will remove sections of the image to allow you to see through to the image below.
Replace:
CGContextSetRGBStrokeColor(UIGraphicsGetCurrentContext(), 1.0, 0.0, 0.0, 1.0);
with:
CGContextSetBlendMode(UIGraphicsGetCurrentContext(), kCGBlendModeClear);