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

# PKToolPicker

A tool palette that displays a selection of drawing tools and colors for tools that a person can choose from.

```
class PKToolPicker
```

## Overview

A [`PKToolPicker`](/documentation/PencilKit/PKToolPicker) manages a draggable palette that displays drawing tools, colors, and additional options. You add a tool picker to your interface and configure it to display its palette at appropriate times. While the palette is onscreen, a person may reposition it anywhere within the current window. When a person interacts with the palette, the tool picker notifies registered observers of the changes so that they can respond.

> Important:
> The tool picker doesn’t display in Mac apps built with Mac Catalyst.

When configuring your interface, call the [`setVisible(_:forFirstResponder:)`](/documentation/PencilKit/PKToolPicker/setVisible(_:forFirstResponder:)) method to associate the tool picker with one or more views in your interface. Each window manages its own tool picker, and the window’s first responder determines the visibility of that tool picker. When one of the registered objects becomes first responder, the tool picker automatically adds its palette view to the current window. When there isn’t a registered object as first responder, the tool picker hides its palette view.

[`PKCanvasView`](/documentation/PencilKit/PKCanvasView) implements the observer protocol for detecting tool picker changes. Adding your canvas view as an observer to a tool picker automatically updates the current drawing tools. For more information about implementing custom observer objects, see [`PKToolPickerObserver`](/documentation/PencilKit/PKToolPickerObserver).

## Topics

### Creating a tool picker

[`init()`](/documentation/PencilKit/PKToolPicker/init())

Creates a new tool picker with a default set of tools.

[`init(toolItems:)`](/documentation/PencilKit/PKToolPicker/init(toolItems:))

Creates a new tool picker with the tools you specify.

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

An item that represents an inking tool in the tool picker.

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

An item that represents an eraser tool in the tool picker.

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

An item that represents a lasso tool in the tool picker.

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

An item that represents a ruler tool in the tool picker.

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

An item that represents a Scribble tool in the tool picker.

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

An item that represents a custom tool in the tool picker.

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

The base class for an item in the tool picker.

### Accessing the picker’s tools

[`toolItems`](/documentation/PencilKit/PKToolPicker/toolItems)

All tool items in the tool picker.

### Detecting changes to the picker

[`addObserver(_:)`](/documentation/PencilKit/PKToolPicker/addObserver(_:))

Adds the specified object to the list of objects to notify when the picker configuration changes.

[`removeObserver(_:)`](/documentation/PencilKit/PKToolPicker/removeObserver(_:))

Removes the specified object from the list of objects to notify when the picker configuration changes.

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

An interface you use to detect when the user changes the selected tools and drawing characteristics of a tool picker object.

### Coordinating the visibility of the picker

[`setVisible(_:forFirstResponder:)`](/documentation/PencilKit/PKToolPicker/setVisible(_:forFirstResponder:))

Sets the visibility for the tool picker, based on when the specified responder object becomes active.

[`isVisible`](/documentation/PencilKit/PKToolPicker/isVisible)

A Boolean value that indicates whether the tool picker is currently visible.

[`frameObscured(in:)`](/documentation/PencilKit/PKToolPicker/frameObscured(in:))

Returns the portion of the specified view that the tool picker obscures.

### Managing selected tools

[`selectedToolItem`](/documentation/PencilKit/PKToolPicker/selectedToolItem)

The currently selected tool item in the tool picker.

[`selectedToolItemIdentifier`](/documentation/PencilKit/PKToolPicker/selectedToolItemIdentifier)

The identifier of the selected tool item in the tool picker.

### Customizing picker behavior

[`isRulerActive`](/documentation/PencilKit/PKToolPicker/isRulerActive)

A Boolean value that indicates whether the ruler is visible on the canvas.

[`colorUserInterfaceStyle`](/documentation/PencilKit/PKToolPicker/colorUserInterfaceStyle)

The user interface style for the tool picker.

[`overrideUserInterfaceStyle`](/documentation/PencilKit/PKToolPicker/overrideUserInterfaceStyle)

The specific user interface style to apply to the tool picker.

[`showsDrawingPolicyControls`](/documentation/PencilKit/PKToolPicker/showsDrawingPolicyControls)

A Boolean value that indicates whether the default drawing policy UI is visible.

[`stateAutosaveName`](/documentation/PencilKit/PKToolPicker/stateAutosaveName)

The name used to automatically save the tool picker’s state in the defaults system.

### Configuring the accessory item

[`accessoryItem`](/documentation/PencilKit/PKToolPicker/accessoryItem)

An optional button that appears at the trailing edge of the tool picker.

### Supporting PencilKit versions

[`maximumSupportedContentVersion`](/documentation/PencilKit/PKToolPicker/maximumSupportedContentVersion)

The maximum version of PencilKit to support.

### Deprecated

[`shared(for:)`](/documentation/PencilKit/PKToolPicker/shared(for:))

Returns the tool picker object to use for the specified window.

[`selectedTool`](/documentation/PencilKit/PKToolPicker/selectedTool-2lptq)

The currently selected tool in the tool picker.

[`selectedTool`](/documentation/PencilKit/PKToolPicker/selectedTool-93ikc)

The currently selected tool in the tool picker.



---

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)