I am trying to crop a layer with other, but, instead of creating a mask (B) and crop the layer (A) getting a cropped layer A with the shape of B, I want to get a layer with shape A and a 'hole' created by cropping with layer B.
************* ***Layer A***
* Layer A * *************
* ***** * **** *****
* * B * * -> **** ***** Layer A without shape B
* ***** * **** *****
* * *************
************* *************
How can I get the cropped layer A?
Swift 3.0 solution:
You have to create a mask that covers the area that you want to keep. This can be done by using an even-odd fill rule and create a path for a shape layer with both rectangles. You can create the shape like this (where the two rectangles would be your two frames). Then you set this as the mask to get the result that you are after.