<!--
{
  "availability" : [
    "iOS: 12.1.0 -",
    "iPadOS: 12.1.0 -",
    "macCatalyst: 13.1.0 -",
    "visionOS: 26.2.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UIPencilPreferredAction",
  "metadataVersion" : "0.1.0",
  "role" : "Enumeration",
  "symbol" : {
    "kind" : "Enumeration",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "c:@E@UIPencilPreferredAction"
  },
  "title" : "UIPencilPreferredAction"
}
-->

# UIPencilPreferredAction

The actions Apple Pencil can perform after a person performs a double tap or squeeze.

```
enum UIPencilPreferredAction
```

## Topics

### Preferred actions

[`case ignore`](/documentation/UIKit/UIPencilPreferredAction/ignore)

An action that does nothing.

[`case switchEraser`](/documentation/UIKit/UIPencilPreferredAction/switchEraser)

An action that switches between the current tool and the eraser.

[`case switchPrevious`](/documentation/UIKit/UIPencilPreferredAction/switchPrevious)

An action that switches between the current tool and the last used tool.

[`case showColorPalette`](/documentation/UIKit/UIPencilPreferredAction/showColorPalette)

An action that toggles the display of the color palette.

[`case showInkAttributes`](/documentation/UIKit/UIPencilPreferredAction/showInkAttributes)

An action that toggles the display of the selected tool’s ink attributes.

[`case showContextualPalette`](/documentation/UIKit/UIPencilPreferredAction/showContextualPalette)

An action that toggles shows a contextual palette of markup tools, or undo and redo options if tools aren’t available.

[`case runSystemShortcut`](/documentation/UIKit/UIPencilPreferredAction/runSystemShortcut)

An action that runs a system shortcut.

### Initializers

[`init?(rawValue: Int)`](/documentation/UIKit/UIPencilPreferredAction/init(rawValue:))

## Relationships

### Conforms To

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

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

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

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

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

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

---

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)