<!--
{
  "availability" : [
    "macOS: 10.12.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSFilePromiseProviderDelegate/filePromiseProvider(_:writePromiseTo:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(pl)NSFilePromiseProviderDelegate(im)filePromiseProvider:writePromiseToURL:completionHandler:"
  },
  "title" : "filePromiseProvider(_:writePromiseTo:completionHandler:)"
}
-->

# filePromiseProvider(_:writePromiseTo:completionHandler:)

Writes the contents of a promise to the specified URL.

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

## 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 <doc://com.apple.documentation/documentation/Foundation/OperationQueue> supplied by [`operationQueue(for:)`](/documentation/AppKit/NSFilePromiseProviderDelegate/operationQueue(for:)).

Call the completion handler with the file contents wrapped in <doc://com.apple.documentation/documentation/Foundation/NSFileCoordinator>.  Be sure to write your file to the input `url` parameter.

---

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)