---
title: PKToolPickerCustomItem
framework: pencilkit
role: symbol
role_heading: Class
path: pencilkit/pktoolpickercustomitem
---

# PKToolPickerCustomItem

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

## Declaration

```swift
class PKToolPickerCustomItem
```

## Overview

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, 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 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 UIGraphicsImageRenderer. // 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.

## Topics

### Creating a custom item

- [init(configuration:)](pencilkit/pktoolpickercustomitem/init(configuration:).md)

### Configuring the custom item

- [color](pencilkit/pktoolpickercustomitem/color.md)
- [width](pencilkit/pktoolpickercustomitem/width.md)
- [configuration](pencilkit/pktoolpickercustomitem/configuration-41nm4.md)
- [PKToolPickerCustomItem.Configuration](pencilkit/pktoolpickercustomitem/configuration-swift.struct.md)

### Reloading the custom item image

- [reloadImage()](pencilkit/pktoolpickercustomitem/reloadimage().md)

### Structures

- [PKToolPickerCustomItem.ControlOptions](pencilkit/pktoolpickercustomitem/controloptions.md)

### Instance Properties

- [allowsColorSelection](pencilkit/pktoolpickercustomitem/allowscolorselection.md)

## Relationships

### Inherits From

- [PKToolPickerItem](pencilkit/pktoolpickeritem.md)

### Conforms To

- [CVarArg](swift/cvararg.md)
- [CustomDebugStringConvertible](swift/customdebugstringconvertible.md)
- [CustomStringConvertible](swift/customstringconvertible.md)
- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)
- [NSCopying](foundation/nscopying.md)
- [NSObjectProtocol](objectivec/nsobjectprotocol.md)

## See Also

### Creating a tool picker

- [init()](pencilkit/pktoolpicker/init().md)
- [init(toolItems:)](pencilkit/pktoolpicker/init(toolitems:).md)
- [PKToolPickerInkingItem](pencilkit/pktoolpickerinkingitem.md)
- [PKToolPickerEraserItem](pencilkit/pktoolpickereraseritem.md)
- [PKToolPickerLassoItem](pencilkit/pktoolpickerlassoitem.md)
- [PKToolPickerRulerItem](pencilkit/pktoolpickerruleritem.md)
- [PKToolPickerScribbleItem](pencilkit/pktoolpickerscribbleitem.md)
- [PKToolPickerItem](pencilkit/pktoolpickeritem.md)
