---
title: "registerFileRepresentation(for:visibility:openInPlace:loadHandler:)"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsitemprovider/registerfilerepresentation(for:visibility:openinplace:loadhandler:)"
---

# registerFileRepresentation(for:visibility:openInPlace:loadHandler:)

Registers a file-backed representation for an item with item visibility, an open-in-place option, and a load handler.

## Declaration

```swift
func registerFileRepresentation(for contentType: UTType, visibility: NSItemProviderRepresentationVisibility = .all, openInPlace: Bool = false, loadHandler: @escaping @Sendable (@escaping (URL?, Bool, (any Error)?) -> Void) -> Progress?)
```

## Discussion

Discussion If a destination app must access the represented file using a file coordinator, set the coordinated parameter in the load handler block to true. To offer a representation backed by a file provider, return an 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; in addition, return an 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.

## See Also

### Registering files

- [registerFileRepresentation(forTypeIdentifier:fileOptions:visibility:loadHandler:)](foundation/nsitemprovider/registerfilerepresentation(fortypeidentifier:fileoptions:visibility:loadhandler:).md)
