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

# PKToolPickerCustomItem

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

```
class PKToolPickerCustomItem
```

## Overview

A custom tool item represents a tool that isn’t one of the system tools. You configure details about a custom tool item yourself using [`PKToolPickerCustomItem.Configuration`](/documentation/PencilKit/PKToolPickerCustomItem/Configuration-swift.struct), including providing custom images to draw the body of the tool.

The following code shows how to create a tool picker with a custom tool item. This basic implementation of [`imageProvider`](/documentation/PencilKit/PKToolPickerCustomItem/Configuration-swift.struct/imageProvider) retrieves an image for the tool body from an asset catalog. A full app might use a more advanced drawing implementation for the image provider, such as using <doc://com.apple.documentation/documentation/UIKit/UIGraphicsImageRenderer>.

```swift
// Create a configuration for a custom tool item.
var config = PKToolPickerCustomItem.Configuration(identifier: "com.example.custom-tool", name: "My Tool")

// Provide a custom image for the custom tool item.
config.imageProvider = { toolItem in
    guard let toolImage = UIImage(named: config.name) else { 
        return UIImage() 
    }
    return toolImage
}

// Configure additional appearance options for the custom tool item.
config.allowsColorSelection = true
config.defaultColor = .red
config.defaultWidth = 10.0

// Create a custom tool item using the configuration.
let customItem = PKToolPickerCustomItem(configuration: config)

// Create a picker with the custom tool item and a system ruler tool.
let items = [customItem, PKToolPickerRulerItem()]
let picker = PKToolPicker(toolItems: items)
```

For a more complete example of creating a custom tool item, see [Configuring the PencilKit tool picker](/documentation/PencilKit/configuring-the-pencilkit-tool-picker).

## Topics

### Creating a custom item

[`init(configuration:)`](/documentation/PencilKit/PKToolPickerCustomItem/init(configuration:))

Creates a new custom item with the specified configuration.

[`-  initWithConfiguration:`](/documentation/PencilKit/PKToolPickerCustomItem/initWithConfiguration:)

Creates a new custom item with the specified configuration.

### Configuring the custom item

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

The current color of the custom tool item.

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

The current width of the custom tool item.

[`configuration`](/documentation/PencilKit/PKToolPickerCustomItem/configuration-41nm4)

The configuration of the custom tool item.

[`Configuration`](/documentation/PencilKit/PKToolPickerCustomItem/Configuration-swift.struct)

A configuration that specifies the appearance and behavior of a custom tool item and its contents.

[`configuration`](/documentation/PencilKit/PKToolPickerCustomItem/configuration-v7e5)

The configuration of the custom tool item.

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

A configuration that specifies the appearance and behavior of a custom tool item and its contents.

### Reloading the custom item image

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

Requests a new image for the custom tool item from the image provider.

## Relationships

### Conforms To

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

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

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

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

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

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

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

### Inherits From

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

---

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)