<!--
{
  "availability" : [
    "iOS: 13.0.0 -",
    "iPadOS: 13.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.15.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "PencilKit",
  "identifier" : "/documentation/PencilKit/PKEraserToolReference",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "PencilKit"
    ],
    "preciseIdentifier" : "c:objc(cs)PKEraserTool"
  },
  "title" : "PKEraserToolReference"
}
-->

# PKEraserToolReference

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

```
class PKEraserToolReference
```

## 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(eraserType: __PKEraserType)`](/documentation/PencilKit/PKEraserToolReference/init(eraserType:))

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

[`init(eraserType: __PKEraserType, width: CGFloat)`](/documentation/PencilKit/PKEraserToolReference/init(eraserType:width:))

### Getting the eraser type

[`var eraserType: __PKEraserType`](/documentation/PencilKit/PKEraserToolReference/eraserType)

The behavior adopted by the eraser when deleting content.

[`enum PKEraserType : NSInteger;`](/documentation/PencilKit/PKEraserType)

Constants that indicate the behavior of the eraser.

### Getting the width information

[`var width: CGFloat`](/documentation/PencilKit/PKEraserToolReference/width)

The width of the eraser.

[`class func defaultWidth(for: __PKEraserType) -> CGFloat`](/documentation/PencilKit/PKEraserToolReference/defaultWidth(for:))

The default width for the specified eraser type.

[`class func minimumWidth(for: __PKEraserType) -> CGFloat`](/documentation/PencilKit/PKEraserToolReference/minimumWidth(for:))

The minimum width for the specified eraser type.

[`class func maximumWidth(for: __PKEraserType) -> CGFloat`](/documentation/PencilKit/PKEraserToolReference/maximumWidth(for:))

The maximum width for the specified eraser type.

## Relationships

### Conforms To

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

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

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

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

[`NSCopying`](/documentation/Foundation/NSCopying)

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

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

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

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

---

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)