Instance Method


Overridden by subclasses to (re)initialize the view’s graphics state object.


func setUpGState()


This method is automatically invoked when the graphics state object created using allocateGState() needs to be initialized. The default implementation does nothing. Your subclass can override it to set the current font, line width, or any other graphics state parameter except coordinate transformations and the clipping path—these are established by the frame and bounds rectangles and by methods such as scaleUnitSquare(to:) and translateOrigin(to:). Note that drawRect: can further transform the coordinate system and clipping path for whatever temporary effects it needs.

See Also

Deprecated Methods

func shouldDrawColor() -> Bool

Returns a Boolean value indicating whether the view is being drawn to an environment that supports color.

func allocateGState()

Causes the view to maintain a private graphics state object, which encapsulates all parameters of the graphics environment.

func gState() -> Int

Returns the identifier for the view’s graphics state object, or 0 if the view doesn’t have a graphics state object.

func renewGState()

Invalidates the view’s graphics state object, if it has one.

func releaseGState()

Frees the view’s graphics state object, if it has one.