Instance Method

drawShading(_:)

Fills the clipping path of a context with the specified shading.

Declaration

func drawShading(_ shading: CGShading)

Parameters

shading

A shading object. The shading object is retained; upon return, you may safely release it.

Discussion

The preferred way to draw gradients is to use a CGGradient object. See CGGradient.

See Also

Drawing Gradients and Shadings

func drawLinearGradient(CGGradient, start: CGPoint, end: CGPoint, options: CGGradientDrawingOptions)

Paints a gradient fill that varies along the line defined by the provided starting and ending points.

struct CGGradientDrawingOptions

Drawing locations for gradients.