Contents

filePromiseProvider(_:writePromiseTo:completionHandler:)

Writes the contents of a promise to the specified URL.

Declaration

nonisolated func filePromiseProvider(_ filePromiseProvider: NSFilePromiseProvider, writePromiseTo url: URL, completionHandler: @escaping  @Sendable ((any Error)?) -> Void)
nonisolated func filePromiseProvider(_ filePromiseProvider: NSFilePromiseProvider, writePromiseTo url: URL) async throws

Parameters

  • filePromiseProvider:

    The file promise provider.

  • url:

    The destination URL to write to.

  • completionHandler:

    A completion handler to execute after the file has been written.

Discussion

This method is called after the drag is complete. The request executes on the OperationQueue supplied by operationQueue(for:).

Call the completion handler with the file contents wrapped in NSFileCoordinator. Be sure to write your file to the input url parameter.

See Also

Handling File Promises