Typically, it will be presented like Figure 3, if use the image masking by below codes,
let maskLayer = CALayer()
maskLayer.contents = [CGImage Object] // CGImage Object is Figure 2
imageView.layer.mask = maskLayer
But, I want to get the reversed result.
The black area of Figure 2 is clear color.
Yes, I can use reversed image for masking.
Let us assume that the size of Figure 1 is 100x100, Figure 2 is 30x30.
The Result is same with Figure 3.
But, the expected result should present Figure 1 area that outside of Figure 2(masking image), like Figure 4.
How can I do that?
Figure 1
Figure 2
Figure 3
Figure 4