Contents

loadInPlaceFileRepresentation(forTypeIdentifier:completionHandler:)

Asynchronously opens a file in place, if possible, returning a progress object.

Declaration

func loadInPlaceFileRepresentation(forTypeIdentifier typeIdentifier: String, completionHandler: @escaping  @Sendable (URL?, Bool, (any Error)?) -> Void) -> Progress

Discussion

The system sets the isInPlace parameter to true if the system successfully opened the file in place, or false if it made a local copy. In either case, you must access the returned URL using an NSFileCoordinator object.

If the system created a local copy of a file, it will be automatically deleted after your file coordinator relinquishes its read access to the file.

See Also

Loading the provider’s contents