Filling a shape with a gradient in CGContext
I want to fill a polygon shape that I have drawn via Core Graphics with a linear CGGradient.  The CGContextDrawLinearGradient function draws a gradient from one point to another but it fills the entire view.  How can I display the gradient only inside the polygon shape I have drawn?
Filling a shape with a gradient in CGContext
===

I want to fill a polygon shape that I have drawn via Core Graphics with a linear CGGradient.  The CGContextDrawLinearGradient function draws a gradient from one point to another but it fills the entire view.  How can I display the gradient only inside the polygon shape I have drawn?