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.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

Learn more about using Apple's beta software