---
title: "registerItem(forTypeIdentifier:loadHandler:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsitemprovider/registeritem(fortypeidentifier:loadhandler:)"
---

# registerItem(forTypeIdentifier:loadHandler:)

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

## Declaration

```swift
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 doc://com.apple.foundation/documentation/Foundation/NSItemProvider/LoadHandler.

## Discussion

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:) 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.

## See Also

### Registering data

- [registerDataRepresentation(forTypeIdentifier:visibility:loadHandler:)](foundation/nsitemprovider/registerdatarepresentation(fortypeidentifier:visibility:loadhandler:).md)
- [registerDataRepresentation(for:visibility:loadHandler:)](foundation/nsitemprovider/registerdatarepresentation(for:visibility:loadhandler:).md)
