<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 11.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PencilKit",
  "identifier" : "/documentation/PencilKit/PKEraserTool-swift.struct",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "PencilKit"
    ],
    "preciseIdentifier" : "s:9PencilKit12PKEraserToolV"
  },
  "title" : "PKEraserTool"
}
-->

# PKEraserTool

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

```
struct PKEraserTool
```

## Overview

A [`PKEraserTool`](/documentation/PencilKit/PKEraserTool-swift.struct) object supports the deletion of content from a [`PKCanvasView`](/documentation/PencilKit/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`](/documentation/PencilKit/PKToolPicker) object and let the user select the eraser. Assign the resulting object to the [`tool`](/documentation/PencilKit/PKCanvasView/tool-6str6) property of your [`PKCanvasView`](/documentation/PencilKit/PKCanvasView) object. The canvas uses any subsequent touch sequences to erase content on the canvas.

## Topics

### Creating an eraser tool

[`init(_:)`](/documentation/PencilKit/PKEraserTool-swift.struct/init(_:))

Creates an eraser tool object that removes objects wholly or partially from a canvas view.

[`init(_:width:)`](/documentation/PencilKit/PKEraserTool-swift.struct/init(_:width:))

Creates an eraser tool object with the specified width.

### Getting the eraser type

[`eraserType`](/documentation/PencilKit/PKEraserTool-swift.struct/eraserType-swift.property)

The behavior adopted by the eraser when deleting content.

[`EraserType`](/documentation/PencilKit/PKEraserTool-swift.struct/EraserType-swift.enum)

Constants that indicate the behavior of the eraser.

### Specifying the width

[`width`](/documentation/PencilKit/PKEraserTool-swift.struct/width)

The width of the eraser.

### Comparing eraser tools

### Using reference types

[`PKEraserToolReference`](/documentation/PencilKit/PKEraserToolReference)

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

## Relationships

### Conforms To

[`Copyable`](/documentation/Swift/Copyable)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Equatable`](/documentation/Swift/Equatable)

[`Escapable`](/documentation/Swift/Escapable)

[`Sendable`](/documentation/Swift/Sendable)

[`PKTool-swift.protocol`](/documentation/PencilKit/PKTool-swift.protocol)

---

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)