A set of drawing attributes that represent the configuration of a graphics renderer context.


class UIGraphicsRendererFormat : NSObject


Create a UIGraphicsRendererFormat object, or one of its subclasses (UIGraphicsImageRendererFormat and UIGraphicsPDFRendererFormat), and use it to construct a graphics renderer by providing the format object as a parameter in a UIGraphicsRenderer subclass intializer.

The graphics renderer uses the format object you provided to configure any context objects (UIGraphicsRendererContext) it creates as part of the rendering process.

If you use a graphics renderer initializer that does not require a format argument, the renderer creates a format object using the default() class method.

The renderer format object contains properties that represent the immutable aspects of the renderer's configuration. This means that repeated uses of a single graphics renderer object will always use the same format object.


Creating a Default Format

class func `default`() -> Self

Returns a new format configured for the highest fidelity supported by the current device.

Getting the Bounds

var bounds: CGRect

The bounds of the associated graphics context.

Type Methods

class func preferred() -> Self

Returns a new format best suited for the main screen’s current configuration.


Inherits From

See Also

Drawing Contexts

class UIGraphicsRenderer

An abstract base class for creating graphics renderers.

class UIGraphicsRendererContext

The base class for the drawing environments associated with graphics renderers.

class UIGraphicsImageRenderer

A graphics renderer for creating Core Graphics-backed images.

class UIGraphicsImageRendererContext

The drawing environment associated with an image renderer.

class UIGraphicsImageRendererFormat

A set of drawing attributes that represent the configuration of an image renderer context.

class UIGraphicsPDFRenderer

A graphics renderer for creating PDFs.

typealias UIGraphicsPDFRenderer.DrawingActions

A handler block that you use to draw PDF content.

class UIGraphicsPDFRendererContext

A drawing environment associated with a PDF renderer.

class UIGraphicsPDFRendererFormat

A set of drawing attributes that represents the configuration of a PDF renderer context.