---
title: "writePlaceholder(at:withMetadata:)"
framework: fileprovider
role: symbol
role_heading: Type Method
path: "fileprovider/nsfileprovidermanager/writeplaceholder(at:withmetadata:)"
---

# writePlaceholder(at:withMetadata:)

Writes a document placeholder with the provided metadata.

## Declaration

```swift
class func writePlaceholder(at placeholderURL: URL, withMetadata metadata: NSFileProviderItem) throws
```

## Parameters

- `placeholderURL`: The placeholder URL for the document. You can generate a placeholder URL from a document URL by calling doc://com.apple.fileprovider/documentation/FileProvider/NSFileProviderExtension/placeholderURL(for:).
- `metadata`: The metadata for this document.

## Discussion

Discussion Call this method whenever you need to create a placeholder for a document. The metadata that you provide sets the data provided to the user in the browser interface. note: While this method is available on macOS 11+, you don’t need to use it when creating a file provider extension that adopts the NSFileProviderReplicatedExtension protocol.

## See Also

### Performing actions

- [placeholderURL(for:)](fileprovider/nsfileprovidermanager/placeholderurl(for:).md)
- [register(_:forItemWithIdentifier:completionHandler:)](fileprovider/nsfileprovidermanager/register(_:foritemwithidentifier:completionhandler:).md)
- [signalEnumerator(for:completionHandler:)](fileprovider/nsfileprovidermanager/signalenumerator(for:completionhandler:).md)
- [waitForChanges(below:completionHandler:)](fileprovider/nsfileprovidermanager/waitforchanges(below:completionhandler:).md)
- [globalProgress(for:)](fileprovider/nsfileprovidermanager/globalprogress(for:).md)
