---
title: PKEraserTool
framework: pencilkit
role: symbol
role_heading: Structure
path: pencilkit/pkerasertool-swift.struct
---

# PKEraserTool

A tool for erasing previously drawn content in a canvas view.

## Declaration

```swift
struct PKEraserTool
```

## Overview

Overview A PKEraserTool object supports the deletion of content from a PKCanvasView object. The eraser tool’s type determines whether the canvas removes entire items or just the portion of an item that it touches. Create an eraser tool programmatically or display a PKToolPicker object and let the user select the eraser. Assign the resulting object to the tool property of your PKCanvasView object. The canvas uses any subsequent touch sequences to erase content on the canvas.

## Topics

### Creating an eraser tool

- [init(_:)](pencilkit/pkerasertool-swift.struct/init(_:).md)
- [init(_:width:)](pencilkit/pkerasertool-swift.struct/init(_:width:).md)

### Getting the eraser type

- [eraserType](pencilkit/pkerasertool-swift.struct/erasertype-swift.property.md)
- [PKEraserTool.EraserType](pencilkit/pkerasertool-swift.struct/erasertype-swift.enum.md)

### Specifying the width

- [width](pencilkit/pkerasertool-swift.struct/width.md)

### Using reference types

- [PKEraserToolReference](pencilkit/pkerasertoolreference.md)

## Relationships

### Conforms To

- [Copyable](swift/copyable.md)
- [Equatable](swift/equatable.md)
- [Escapable](swift/escapable.md)
- [PKTool](pencilkit/pktool-swift.protocol.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Tools

- [Configuring the PencilKit tool picker](pencilkit/configuring-the-pencilkit-tool-picker.md)
- [PKToolPicker](pencilkit/pktoolpicker.md)
- [PKInkingTool](pencilkit/pkinkingtool-swift.struct.md)
- [PKLassoTool](pencilkit/pklassotool-swift.struct.md)
- [PKTool](pencilkit/pktool-swift.protocol.md)
