<!--
{
  "documentType" : "article",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/drawing",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Drawing"
}
-->

# Drawing

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

## Topics

### UI updates

[`UIUpdateLink`](/documentation/UIKit/UIUpdateLink)

An object you use to observe, participate in, and affect the UI update process.

[`UIUpdateInfo`](/documentation/UIKit/UIUpdateInfo)

An object that contains detailed information about the current UI update state.

[`UIUpdateActionPhase`](/documentation/UIKit/UIUpdateActionPhase)

An object that defines specific phases of the UI update process.

### Color

[`UIColor`](/documentation/UIKit/UIColor)

An object that stores color data and sometimes opacity.

### Graphics contexts

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

[`UIGraphicsRenderer`](/documentation/UIKit/UIGraphicsRenderer)

An abstract base class for creating graphics renderers.

[`UIGraphicsRendererContext`](/documentation/UIKit/UIGraphicsRendererContext)

The base class for the drawing environments for graphics renderers.

[`UIGraphicsRendererFormat`](/documentation/UIKit/UIGraphicsRendererFormat)

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

[`UIGraphicsImageRenderer`](/documentation/UIKit/UIGraphicsImageRenderer)

A graphics renderer for creating Core Graphics-backed images.

[`UIGraphicsImageRendererContext`](/documentation/UIKit/UIGraphicsImageRendererContext)

The drawing environment for an image renderer.

[`UIGraphicsImageRendererFormat`](/documentation/UIKit/UIGraphicsImageRendererFormat)

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

[`UIGraphicsPDFRenderer`](/documentation/UIKit/UIGraphicsPDFRenderer)

A graphics renderer for creating PDFs.

[`UIGraphicsPDFRendererContext`](/documentation/UIKit/UIGraphicsPDFRendererContext)

The drawing environment for a PDF renderer.

[`UIGraphicsPDFRendererFormat`](/documentation/UIKit/UIGraphicsPDFRendererFormat)

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

### Paths

[`UIBezierPath`](/documentation/UIKit/UIBezierPath)

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

[`UIRectFill(_:)`](/documentation/UIKit/UIRectFill(_:))

Fills the specified rectangle with the current color.

[`UIRectFillUsingBlendMode(_:_:)`](/documentation/UIKit/UIRectFillUsingBlendMode(_:_:))

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

[`UIRectFrame(_:)`](/documentation/UIKit/UIRectFrame(_:))

Draws a frame around the inside of the specified rectangle.

[`UIRectFrameUsingBlendMode(_:_:)`](/documentation/UIKit/UIRectFrameUsingBlendMode(_:_:))

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

### Strings

[`NSStringDrawingContext`](/documentation/UIKit/NSStringDrawingContext)

An object that manages metrics for drawing attributed strings.

[`NSStringDrawingOptions`](/documentation/UIKit/NSStringDrawingOptions)

Constants that specify the rendering options for drawing a string.

[`UIBaselineAdjustment`](/documentation/UIKit/UIBaselineAdjustment)

Vertical adjustment options.

[`UILineBreakMode`](/documentation/UIKit/UILineBreakMode)

Options for wrapping and truncating text.

[`UITextAlignment`](/documentation/UIKit/UITextAlignment)

Options for aligning text horizontally.

[`UITextAttributeFont`](/documentation/UIKit/UITextAttributeFont)

The key to the font in a text attributes dictionary.

[`UITextAttributeTextColor`](/documentation/UIKit/UITextAttributeTextColor)

The key to the text color in a text attributes dictionary.

[`UITextAttributeTextShadowColor`](/documentation/UIKit/UITextAttributeTextShadowColor)

The key to the text shadow color in a text attributes dictionary.

[`UITextAttributeTextShadowOffset`](/documentation/UIKit/UITextAttributeTextShadowOffset)

The key to the offset for the text shadow in a text attributes dictionary.

### Shadows

[`NSShadow`](/documentation/UIKit/NSShadow)

An object you use to specify attributes to create and style a drop shadow during drawing operations.

### Graphics context primitives

Manage the current graphics environment using Core Graphics framework types.

[`UIGraphicsGetCurrentContext()`](/documentation/UIKit/UIGraphicsGetCurrentContext())

Returns the current graphics context.

[`UIGraphicsPushContext(_:)`](/documentation/UIKit/UIGraphicsPushContext(_:))

Makes the specified graphics context the current context.

[`UIGraphicsPopContext()`](/documentation/UIKit/UIGraphicsPopContext())

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

[`UIGraphicsBeginImageContextWithOptions(_:_:_:)`](/documentation/UIKit/UIGraphicsBeginImageContextWithOptions(_:_:_:))

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

[`UIRectClip(_:)`](/documentation/UIKit/UIRectClip(_:))

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

### Primitive type conversions

  <doc://com.apple.documentation/documentation/Foundation/NSCoder/cgAffineTransform(for:)>

  <doc://com.apple.documentation/documentation/Foundation/NSCoder/cgPoint(for:)>

  <doc://com.apple.documentation/documentation/Foundation/NSCoder/cgRect(for:)>

  <doc://com.apple.documentation/documentation/Foundation/NSCoder/cgSize(for:)>

  <doc://com.apple.documentation/documentation/Foundation/NSCoder/cgVector(for:)>

  <doc://com.apple.documentation/documentation/Foundation/NSCoder/string(for:)-6yx6n>

  <doc://com.apple.documentation/documentation/Foundation/NSCoder/string(for:)-6ix86>

  <doc://com.apple.documentation/documentation/Foundation/NSCoder/string(for:)-4qz0a>

  <doc://com.apple.documentation/documentation/Foundation/NSCoder/string(for:)-2f1xb>

  <doc://com.apple.documentation/documentation/Foundation/NSCoder/string(for:)-4omzv>

### Primitive type conversions

[`CGAffineTransformFromString`](/documentation/UIKit/CGAffineTransformFromString)

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

[`CGPointFromString`](/documentation/UIKit/CGPointFromString)

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

[`CGRectFromString`](/documentation/UIKit/CGRectFromString)

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

[`CGSizeFromString`](/documentation/UIKit/CGSizeFromString)

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

[`CGVectorFromString`](/documentation/UIKit/CGVectorFromString)

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

[`NSStringFromCGAffineTransform`](/documentation/UIKit/NSStringFromCGAffineTransform)

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

[`NSStringFromCGPoint`](/documentation/UIKit/NSStringFromCGPoint)

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

[`NSStringFromCGRect`](/documentation/UIKit/NSStringFromCGRect)

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

[`NSStringFromCGSize`](/documentation/UIKit/NSStringFromCGSize)

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

[`NSStringFromCGVector`](/documentation/UIKit/NSStringFromCGVector)

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



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)