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

# PKToolPickerCustomItemConfiguration

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

```
@interface PKToolPickerCustomItemConfiguration : NSObject
```

## Topics

### Creating a configuration

[`- (instancetype) initWithIdentifier:(NSString *) identifier name:(NSString *) name;`](/documentation/PencilKit/PKToolPickerCustomItemConfiguration/initWithIdentifier:name:)

Create a new configuration with an identifier and a name.

### Identifying the custom item

[`@property (nonatomic, copy) NSString * identifier;`](/documentation/PencilKit/PKToolPickerCustomItemConfiguration/identifier)

A string that uniquely identifies the tool in the picker.

[`@property (nonatomic, copy) NSString * name;`](/documentation/PencilKit/PKToolPickerCustomItemConfiguration/name)

A short string to show as the name of the tool in the UI.

### Customizing color

[`@property (nonatomic, strong) UIColor * defaultColor;`](/documentation/PencilKit/PKToolPickerCustomItemConfiguration/defaultColor)

The default color for the tool.

[`@property (nonatomic, assign) BOOL allowsColorSelection;`](/documentation/PencilKit/PKToolPickerCustomItemConfiguration/allowsColorSelection)

A Boolean value that determines whether to show the color selection UI for the tool.

### Customizing width

[`@property (nonatomic, assign) CGFloat defaultWidth;`](/documentation/PencilKit/PKToolPickerCustomItemConfiguration/defaultWidth)

The default width for the tool.

[`@property (nonatomic, copy) NSDictionary<NSNumber *,UIImage *> * widthVariants;`](/documentation/PencilKit/PKToolPickerCustomItemConfiguration/widthVariants)

A dictionary with UI options for selecting width, with each element containing a width value and its corresponding image.

### Providing an image for the tool

[`@property (nonatomic, copy, nullable) UIImage * (^imageProvider)(PKToolPickerCustomItem *toolPickerItem);`](/documentation/PencilKit/PKToolPickerCustomItemConfiguration/imageProvider)

A closure that provides an image for the tool.

### Providing a custom view controller for the tool

[`@property (nonatomic, copy, nullable) UIViewController * (^viewControllerProvider)(PKToolPickerCustomItem *toolPickerItem);`](/documentation/PencilKit/PKToolPickerCustomItemConfiguration/viewControllerProvider)

A closure to provide a view controller above the system controls in the tool attributes popover.

### Instance Properties

[`@property (nonatomic, assign) PKToolPickerCustomItemControlOptions toolAttributeControls;`](/documentation/PencilKit/PKToolPickerCustomItemConfiguration/toolAttributeControls)

Defines which attribute controls are available to be presented in UI such as the tool attributes popover, or inline in the picker presented from a pencil squeeze.
Controls for properties which the tool item does not support will not be presented. Excluding a control here does not hide all UI for adjusting that value.
For example, excluding the opacity control here will not remove it from the color picker, if the color picker is otherwise available.
Defaults to all controls.

## Relationships

### Conforms To

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

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)