Drawing

Configure your app's drawing environment using colors, renderers, draw paths, strings, and shadows.

Topics

Color

UIColor

An object that stores color data and sometimes opacity.

Drawing Contexts

Use renderers to turn a set of programmatic drawing commands into a bitmap or PDF image.

UIGraphicsRenderer

An abstract base class for creating graphics renderers.

UIGraphicsRendererContext

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

UIGraphicsRendererFormat

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

UIGraphicsImageRenderer

A graphics renderer for creating Core Graphics-backed images.

UIGraphicsImageRendererContext

The drawing environment associated with an image renderer.

UIGraphicsImageRendererFormat

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

UIGraphicsPDFRenderer

A graphics renderer for creating PDFs.

UIGraphicsPDFDrawingActions

A handler block that you use to draw PDF content.

UIGraphicsPDFRendererContext

A drawing environment associated with a PDF renderer.

UIGraphicsPDFRendererFormat

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

Paths

UIBezierPath

A path that consists of straight and curved line segments that you can render in your custom views.

UIRectFill

Fills the specified rectangle with the current color.

UIRectFillUsingBlendMode

Fills a rectangle with the current fill color using the specified blend mode.

UIRectFrame

Draws a frame around the inside of the specified rectangle.

UIRectFrameUsingBlendMode

Draws a frame around the inside of a rectangle using the specified blend mode.

Strings

NSStringDrawingContext

An object that manages metrics used when drawing attributed strings.

NSStringDrawingOptions

Constants for the rendering options for a string when it is drawn.

UIBaselineAdjustment

Vertical adjustment options.

UILineBreakMode

Options for wrapping and truncating text.

Deprecated
UITextAlignment

Options for aligning text horizontally.

Deprecated
UITextAttributeFont

Key to the font in a text attributes dictionary.

Deprecated
UITextAttributeTextColor

Key to the text color in a text attributes dictionary.

Deprecated
UITextAttributeTextShadowColor

Key to the text shadow color in a text attributes dictionary.

Deprecated
UITextAttributeTextShadowOffset

Key to the offset used for the text shadow in a text attributes dictionary.

Deprecated

Shadows

NSShadow

An encapsulation of the attributes used to create a drop shadow during drawing operations.

Drawing Context Primitives

Manage the current graphics environment using Core Graphics framework types.

UIGraphicsGetCurrentContext

Returns the current graphics context.

UIGraphicsPushContext

Makes the specified graphics context the current context.

UIGraphicsPopContext

Removes the current graphics context from the top of the stack, restoring the previous context.

UIGraphicsBeginImageContextWithOptions

Creates a bitmap-based graphics context with the specified options.

UIRectClip

Modifies the current clipping path by intersecting it with the specified rectangle.

Primitive Type Conversions

CGAffineTransformFromString

Returns a Core Graphics affine transform structure corresponding to the data in a given string.

CGPointFromString

Returns a Core Graphics point structure corresponding to the data in a given string.

CGRectFromString

Returns a Core Graphics rectangle structure corresponding to the data in a given string.

CGSizeFromString

Returns a Core Graphics size structure corresponding to the data in a given string.

CGVectorFromString

Returns a Core Graphics vector corresponding to the data in a given string.

NSStringFromCGAffineTransform

Returns a string formatted to contain the data from an affine transform.

NSStringFromCGPoint

Returns a string formatted to contain the data from a point.

NSStringFromCGRect

Returns a string formatted to contain the data from a rectangle.

NSStringFromCGSize

Returns a string formatted to contain the data from a size data structure.

NSStringFromCGVector

Returns a string formatted to contain the data from a vector data structure.

See Also

Graphics, Drawing, and Printing

Images and PDF

Create and manage images, including those that use bitmap and PDF formats.

Printing

Display the system print panels and manage the printing process.