---
title: "register(_:forItemIdentifier:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nsscrubber/register(_:foritemidentifier:)-2rb69"
---

# register(_:forItemIdentifier:)

Registers a class for the scrubber to use when it creates new items.

## Declaration

```swift
func register(_ itemViewClass: AnyClass?, forItemIdentifier itemIdentifier: NSUserInterfaceItemIdentifier)
```

## Parameters

- `itemViewClass`: A class to use for creating items. The class must be descended from doc://com.apple.appkit/documentation/AppKit/NSScrubberItemView. Specify nil to unregister a previously registered class.
- `itemIdentifier`: The string that identifies the type of item. You use this string later when requesting new item views. The string must be unique among the other registered item view classes of this scrubber. This parameter must not be an empty string or nil.

## See Also

### Creating scrubber items

- [register(_:forItemIdentifier:)](appkit/nsscrubber/register(_:foritemidentifier:)-6jye0.md)
- [makeItem(withIdentifier:owner:)](appkit/nsscrubber/makeitem(withidentifier:owner:).md)
