Instance Method

draw(_:in:)

Draws the contents of a layer object into the specified rectangle.

Declaration

func draw(_ layer: CGLayer, in rect: CGRect)

Parameters

layer

The layer whose contents you want to draw.

rect

The rectangle, in current user space coordinates, to draw in.

Discussion

The contents are scaled, if necessary, to fit into the rectangle.

See Also

Drawing Core Graphics Layers

func draw(CGLayer, at: CGPoint)

Draws the contents of a layer object at the specified point.

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