<!--
{
  "availability" : [
    "iOS: 2.0.0 -",
    "iPadOS: 2.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.0.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSItemProvider/CompletionHandler",
  "metadataVersion" : "0.1.0",
  "role" : "Type Alias",
  "symbol" : {
    "kind" : "Type Alias",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:@T@NSItemProviderCompletionHandler"
  },
  "title" : "NSItemProvider.CompletionHandler"
}
-->

# NSItemProvider.CompletionHandler

A block that receives the item provider’s data.

```
typealias CompletionHandler = @Sendable ((any NSSecureCoding)?, (any Error)?) -> Void
```

## Discussion

Use this block to receive data from a call to the [`loadItem(forTypeIdentifier:options:completionHandler:)`](/documentation/Foundation/NSItemProvider/loadItem(forTypeIdentifier:options:completionHandler:)) method. This block takes the following parameters:

- item: The item to be loaded. When specifying your block, set the type of this parameter to the specific data type you want. For example, when requesting text data, you might set the type to [`NSString`](/documentation/Foundation/NSString) or [`NSAttributedString`](/documentation/Foundation/NSAttributedString). The item provider attempts to coerce the data to the class you specify.
- error: A pointer to an error object for receiving information about any problems that occurred when loading the data.

---

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)