You cannot draw using Quartz outside the borders of CALayer or UIView. As Noah suggests, you will need to extend the borders of the layer by a given amount in order to draw this.
You can still do this without executing any drawing in the parent layer if the property of the parent layer is masksToBoundsset to NO. Thus, even if your sublevel extends beyond the edge of the parent, it will still be drawn correctly.
source
share