---
title: "init(data:)"
framework: pencilkit
role: symbol
role_heading: Initializer
path: "pencilkit/pkdrawing-swift.struct/init(data:)"
---

# init(data:)

Creates a drawing object and populates it with previously drawn content.

## Declaration

```swift
init(data: Data) throws
```

## Parameters

- `data`: The initial data to add to the canvas. Only specify data you previously obtained from a canvas view.

## Discussion

Discussion This initializer creates a new canvas object initialized with the specified data.

## See Also

### Creating a drawing object

- [init(strokes:)](pencilkit/pkdrawing-swift.struct/init(strokes:).md)
- [init()](pencilkit/pkdrawing-swift.struct/init().md)
