Instance Property

context

Returns the graphics context associated with a layer object.

Declaration

var context: CGContext? { get }

Parameters

layer

The layer whose graphics context you want to obtain.

Return Value

The graphics context associated with the layer.

Discussion

The context that’s returned is the context for the layer itself, not the context that you specified when you created the layer.

See Also

Examining a Layer

var size: CGSize

Returns the width and height of a layer object.