<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "FileProvider",
  "identifier" : "/documentation/FileProvider/NSFileProviderExtension/startProvidingItem(at:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "File Provider"
    ],
    "preciseIdentifier" : "c:objc(cs)NSFileProviderExtension(im)startProvidingItemAtURL:completionHandler:"
  },
  "title" : "startProvidingItem(at:completionHandler:)"
}
-->

# startProvidingItem(at:completionHandler:)

Provides an actual file on disk for a placeholder.

```
func startProvidingItem(at url: URL, completionHandler: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`url`

The URL of a shared document.

`completionHandler`

A block to be called as soon as the file is available.

    The completion handler takes the following parameter:

- error: If the document was produced, this value is `nil`. Otherwise, it holds an `NSError` object describing the error.

## Discussion

> Important:
> You can call this method from synchronous code using a completion handler, as shown on this page, or you can call it as an asynchronous method that has the following declaration:
> 
> ```swift
> func startProvidingItem(at url: URL) async throws
> ```
> 
> For information about concurrency and asynchronous code in Swift, see <doc://com.apple.documentation/documentation/Swift/calling-objective-c-apis-asynchronously>.

This method is called whenever another process tries to access a placeholder for a shared document.

Override this method to download, create, or otherwise provide the file. As soon as the file is available, call the provided completion handler. If any errors occur during this process, pass the error to the completion handler. The system then passes the error back to the original coordinated read or write.

You must override this method. Do not call `super` in your implementations.

> Note:
> Do not use file coordination inside this method. The system already guarantees that no other process can access the file while this method is executing.

---

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)