---
title: "drawLayer(content:)"
framework: swiftui
role: symbol
role_heading: Instance Method
path: "swiftui/graphicscontext/drawlayer(content:)"
---

# drawLayer(content:)

Draws a new layer, created by drawing code that you provide, into the context.

## Declaration

```swift
func drawLayer(content: (inout GraphicsContext) throws -> Void) rethrows
```

## Parameters

- `content`: A closure that receives a new doc://com.apple.SwiftUI/documentation/SwiftUI/GraphicsContext as input. This context represents a new transparency layer that you can draw into. When the closure returns, SwiftUI draws the new layer into the current context.
