How does one draw a CGGradient on an enclosed path within a view? I have attempted to draw the gradient, however, it is drawn on the view itself, rather than only within a CGPath that I am filling inside the view. I would like to draw a gradient on the filled path only, and not on the view itself.
Example:
CGContextSaveGState(context);
CGContextAddPath(context, myPath);
CGContextClip(context);
CGContextDrawLinearGradient(context, gradient, startPoint, endPoint, kNilOptions);
CGContextRestoreGState(context);