<!--
{
  "availability" : [
    "macOS: 10.12.2 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSScrubber/register(_:forItemIdentifier:)-2rb69",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSScrubber(im)registerClass:forItemIdentifier:"
  },
  "title" : "register(_:forItemIdentifier:)"
}
-->

# register(_:forItemIdentifier:)

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

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

## Parameters

`itemViewClass`

A class to use for creating items. The class must be descended from [`NSScrubberItemView`](/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`.

---

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)