<!--
{
  "availability" : [
    "iOS: 8.0.0 - 27.0.0",
    "iPadOS: 8.0.0 - 27.0.0",
    "macCatalyst: 13.1.0 - 27.0.0",
    "macOS: 10.10.0 - 27.0.0",
    "tvOS: 9.0.0 - 27.0.0",
    "visionOS: 1.0.0 - 27.0.0",
    "watchOS: 2.0.0 - 27.0.0"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSItemProvider/registerItem(forTypeIdentifier:loadHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSItemProvider(im)registerItemForTypeIdentifier:loadHandler:"
  },
  "title" : "registerItem(forTypeIdentifier:loadHandler:)"
}
-->

# registerItem(forTypeIdentifier:loadHandler:)

Lazily registers an item, according to the item provider type coercion policy.

```
func registerItem(forTypeIdentifier typeIdentifier: String, loadHandler: @escaping NSItemProvider.LoadHandler)
```

## Parameters

`typeIdentifier`

A string that represents the desired UTI.

`loadHandler`

A block capable of returning the data item as the specified type. For information about implementing this block, see [`NSItemProvider.LoadHandler`](/documentation/Foundation/NSItemProvider/LoadHandler).

## Discussion

Use this method to register blocks that can take the item provider’s file or data object and convert it to a specific data format. Your `loadHandler` block is executed when a client passes the same `typeIdentifier` string to the [`loadItem(forTypeIdentifier:options:completionHandler:)`](/documentation/Foundation/NSItemProvider/loadItem(forTypeIdentifier:options:completionHandler:)) method. In the implementation of your block, coerce the data to the specified type and call the provided completion handler. You must call the completion handler, either with the requested data or with an error.

Item providers know how to coerce known types of objects, such as images or strings. Use this method to register blocks to coerce your custom data types.

---

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)