<!--
{
  "availability" : [
    "iOS: 11.0.0 -",
    "iPadOS: 11.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.13.0 -",
    "tvOS: 11.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 4.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Foundation",
  "identifier" : "/documentation/Foundation/NSItemProvider/registerFileRepresentation(forTypeIdentifier:fileOptions:visibility:loadHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Foundation"
    ],
    "preciseIdentifier" : "c:objc(cs)NSItemProvider(im)registerFileRepresentationForTypeIdentifier:fileOptions:visibility:loadHandler:"
  },
  "title" : "registerFileRepresentation(forTypeIdentifier:fileOptions:visibility:loadHandler:)"
}
-->

# registerFileRepresentation(forTypeIdentifier:fileOptions:visibility:loadHandler:)

Registers a file-backed representation for an item, specifying file options, item visibility, and a load handler.

```
func registerFileRepresentation(forTypeIdentifier typeIdentifier: String, fileOptions: NSItemProviderFileOptions = [], visibility: NSItemProviderRepresentationVisibility, loadHandler: @escaping @Sendable (@escaping @Sendable (URL?, Bool, (any Error)?) -> Void) -> Progress?)
```

## Discussion

If a destination app must access the represented file using a file coordinator, set the `coordinated` parameter in the load handler block to <doc://com.apple.documentation/documentation/Swift/true>.

To offer a representation backed by a file provider, return an [`NSURL`](/documentation/Foundation/NSURL) object that points to your app’s file provider’s container. The file provider extension is then invoked to retrieve the file when requested.

To offer a representation backed by a file to open in place, set the fileOptions parameter to a value of [`openInPlace`](/documentation/Foundation/NSItemProviderFileOptions/openInPlace); in addition, return an [`NSURL`](/documentation/Foundation/NSURL) object that points to your app’s file provider’s container. Open-in-place support requires that the file provider is visible in the Files app.

---

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)