Instance Method


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


func gState() -> Int


A view object’s graphics state object is recreated from scratch whenever the view is focused, unless the allocateGState() method has been invoked. So if the view hasn’t been focused or hasn’t received the allocateGState() message, this method returns 0.

Although applications rarely need to use the value returned by gState(), it can be passed to the few methods that take an object identifier as a parameter.

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 setUpGState()

Overridden by subclasses to (re)initialize the view’s 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.