Sometimes you will want to draw a more complex shape in an app that doesn’t use OpenGL, and you don’t want to load in the graphics from a file, and this can be done using CoreGraphics.
A situation that can arise is the drawing of one shape within another shape. The easiest way to do this is simply to draw the shape on top of the other shape, but this typically will not give the most efficient performance.
Also, there could be a situation when you want the user to see the background through the shape that you are drawing, and if that background is changing simply drawing shapes over top of each other isn’t going to cut it.
For those situations Matt Gallagher from Cocoa With Love has created a tutorial explaining 5 different techniques for drawing a shape with a hole in core graphics.
[Source: Cocoa With Love]