<!--
{
  "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/loadItem(forTypeIdentifier:options:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSItemProvider(im)loadItemForTypeIdentifier:options:completionHandler:"
  },
  "title" : "loadItem(forTypeIdentifier:options:completionHandler:)"
}
-->

# loadItem(forTypeIdentifier:options:completionHandler:)

Loads the item’s data and coerces it to the specified type.

```
func loadItem(forTypeIdentifier typeIdentifier: String, options: [AnyHashable : Any]? = nil, completionHandler: NSItemProvider.CompletionHandler? = nil)
```

## Parameters

`typeIdentifier`

A string that represents the desired UTI.

`options`

A dictionary of keys and values that provide information about the item, such as the size of an image. (See [`NSItemProviderPreferredImageSizeKey`](/documentation/Foundation/NSItemProviderPreferredImageSizeKey) for a key you can use.)

`completionHandler`

A completion handler block to execute with the results. For information about the format of this block, see [`NSItemProvider.CompletionHandler`](/documentation/Foundation/NSItemProvider/CompletionHandler).

## Discussion

Call this method when you want to retrieve the item provider’s data. If the item provider object is able to provide data in the requested type, it does so and asynchronously executes your `completionHandler` block with the results. The block may be executed on a background thread.

The type information for the first parameter of your `completionHandler` block should be set to the class of the expected type. For example, when requesting text data, you might set the type of the first parameter to [`NSString`](/documentation/Foundation/NSString) or [`NSAttributedString`](/documentation/Foundation/NSAttributedString). An item provider can perform simple type conversions of the data to the class you specify, such as from [`NSURL`](/documentation/Foundation/NSURL) to [`NSData`](/documentation/Foundation/NSData) or [`FileWrapper`](/documentation/Foundation/FileWrapper), or from [`NSData`](/documentation/Foundation/NSData) to <doc://com.apple.documentation/documentation/UIKit/UIImage> (in iOS) or <doc://com.apple.documentation/documentation/AppKit/NSImage> (in macOS). If the data could not be retrieved or coerced to the specified class, an error is passed to the completion block’s.

---

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)