---
title: PKDrawingReference
framework: pencilkit
role: symbol
role_heading: Class
path: pencilkit/pkdrawingreference
---

# PKDrawingReference

A data structure that contains the drawing information captured by a canvas view.

## Declaration

```swift
class PKDrawingReference
```

## Overview

Overview A PKDrawingReference object stores the user-drawn content from a PKCanvasView object. You use drawing objects to store the data associated with your user’s drawings. You can save this data with the rest of your app’s content, and you can use that saved data to create a new drawing object later. You can also generate an image based on the drawn content.

## Topics

### Creating a drawing object

- [init(data:)](pencilkit/pkdrawingreference/init(data:).md)
- [init(strokes:)](pencilkit/pkdrawingreference/init(strokes:).md)
- [init()](pencilkit/pkdrawingreference/init().md)

### Getting the canvas bounds

- [bounds](pencilkit/pkdrawingreference/bounds.md)

### Generating an image

- [image(from:scale:)](pencilkit/pkdrawingreference/image(from:scale:).md)

### Getting the drawing data

- [strokes](pencilkit/pkdrawingreference/strokes.md)
- [dataRepresentation()](pencilkit/pkdrawingreference/datarepresentation().md)
- [PKAppleDrawingTypeIdentifier](pencilkit/pkappledrawingtypeidentifier.md)

### Modifying the drawing

- [applying(_:)](pencilkit/pkdrawingreference/applying(_:).md)
- [appendingStrokes(_:)](pencilkit/pkdrawingreference/appendingstrokes(_:).md)
- [appending(_:)](pencilkit/pkdrawingreference/appending(_:).md)

### Supporting backward compatibility

- [requiredContentVersion](pencilkit/pkdrawingreference/requiredcontentversion.md)

### Initializers

- [init(coder:)](pencilkit/pkdrawingreference/init(coder:).md)

### Instance Methods

- [erasingStrokePath(_:mask:transform:)](pencilkit/pkdrawingreference/erasingstrokepath(_:mask:transform:).md)

## Relationships

### Inherits From

- [NSObject](objectivec/nsobject-swift.class.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCoding](foundation/nscoding.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)
- [NSSecureCoding](foundation/nssecurecoding.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)
