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

# NSFileProviderExtension

The principal class for the nonreplicated File Provider extension.

```
class NSFileProviderExtension
```

## Overview

To create a nonreplicated File Provider extension, start by creating a subclass of the [`NSFileProviderExtension`](/documentation/FileProvider/NSFileProviderExtension) class. When implementing your [`NSFileProviderExtension`](/documentation/FileProvider/NSFileProviderExtension) subclass, remember:

- Override all of the extension’s methods (except the deprecated methods), even if your implementation is only an empty method.
- Use your method implementations to provide access to the documents and folders managed by your file provider.
- Don’t call `super` in your method implementations.

Don’t use the [`NSFileProviderExtension`](/documentation/FileProvider/NSFileProviderExtension) class in macOS. Instead, create an <doc://com.apple.documentation/documentation/ObjectiveC/NSObject-swift.class> subclass that adopts the [`NSFileProviderReplicatedExtension`](/documentation/FileProvider/NSFileProviderReplicatedExtension) and [`NSFileProviderEnumerating`](/documentation/FileProvider/NSFileProviderEnumerating) protocols. For more information, see [Replicated File Provider extension](/documentation/FileProvider/replicated-file-provider-extension).

## Topics

### Working with items and persistent identifiers

[`persistentIdentifierForItem(at:)`](/documentation/FileProvider/NSFileProviderExtension/persistentIdentifierForItem(at:))

Returns a unique identifier for the given URL.

[`urlForItem(withPersistentIdentifier:)`](/documentation/FileProvider/NSFileProviderExtension/urlForItem(withPersistentIdentifier:))

Returns the URL for a given persistent identifier.

[`item(for:)`](/documentation/FileProvider/NSFileProviderExtension/item(for:))

Returns a description of the item associated with the persistent identifier.

[`enumerator(for:)`](/documentation/FileProvider/NSFileProviderExtension/enumerator(for:))

Returns an enumerator for the specified item.

[`NSFileProviderItemIdentifier`](/documentation/FileProvider/NSFileProviderItemIdentifier)

A unique identifier for an item managed by the File Provider extension.

### Managing shared files

[`itemChanged(at:)`](/documentation/FileProvider/NSFileProviderExtension/itemChanged(at:))

Tells the File Provider extension that a document has changed.

[`providePlaceholder(at:completionHandler:)`](/documentation/FileProvider/NSFileProviderExtension/providePlaceholder(at:completionHandler:))

Triggers the creation of a placeholder for the given URL.

[`startProvidingItem(at:completionHandler:)`](/documentation/FileProvider/NSFileProviderExtension/startProvidingItem(at:completionHandler:))

Provides an actual file on disk for a placeholder.

[`stopProvidingItem(at:)`](/documentation/FileProvider/NSFileProviderExtension/stopProvidingItem(at:))

Tells the File Provider extension that a given document is no longer being accessed.

### Handling actions

[Providing support for user-driven actions](/documentation/FileProvider/providing-support-for-user-driven-actions)

Override methods to handle user-initiated actions.

[`createDirectory(withName:inParentItemIdentifier:completionHandler:)`](/documentation/FileProvider/NSFileProviderExtension/createDirectory(withName:inParentItemIdentifier:completionHandler:))

Creates a directory with the given name inside the given parent directory.

[`deleteItem(withIdentifier:completionHandler:)`](/documentation/FileProvider/NSFileProviderExtension/deleteItem(withIdentifier:completionHandler:))

Permanently deletes an item from the trash.

[`importDocument(at:toParentItemIdentifier:completionHandler:)`](/documentation/FileProvider/NSFileProviderExtension/importDocument(at:toParentItemIdentifier:completionHandler:))

Imports a file or package into the given parent directory.

[`renameItem(withIdentifier:toName:completionHandler:)`](/documentation/FileProvider/NSFileProviderExtension/renameItem(withIdentifier:toName:completionHandler:))

Renames a document or directory.

[`reparentItem(withIdentifier:toParentItemWithIdentifier:newName:completionHandler:)`](/documentation/FileProvider/NSFileProviderExtension/reparentItem(withIdentifier:toParentItemWithIdentifier:newName:completionHandler:))

Moves the specified item into the given parent directory.

[`setFavoriteRank(_:forItemIdentifier:completionHandler:)`](/documentation/FileProvider/NSFileProviderExtension/setFavoriteRank(_:forItemIdentifier:completionHandler:))

Marks a directory as a favorite and sets its relative order in the Favorites list.

[`setLastUsedDate(_:forItemIdentifier:completionHandler:)`](/documentation/FileProvider/NSFileProviderExtension/setLastUsedDate(_:forItemIdentifier:completionHandler:))

Marks an item as recently used and sets its relative order in the Recents list.

[`setTagData(_:forItemIdentifier:completionHandler:)`](/documentation/FileProvider/NSFileProviderExtension/setTagData(_:forItemIdentifier:completionHandler:))

Tags an item.

[`trashItem(withIdentifier:completionHandler:)`](/documentation/FileProvider/NSFileProviderExtension/trashItem(withIdentifier:completionHandler:))

Moves an item into the trash.

[`untrashItem(withIdentifier:toParentItemIdentifier:completionHandler:)`](/documentation/FileProvider/NSFileProviderExtension/untrashItem(withIdentifier:toParentItemIdentifier:completionHandler:))

Moves an item out of the trash.

### Managing domains

[`domain`](/documentation/FileProvider/NSFileProviderExtension/domain)

The domain managed by this file provider object.

### Accessing thumbnails

[`fetchThumbnails(for:requestedSize:perThumbnailCompletionHandler:completionHandler:)`](/documentation/FileProvider/NSFileProviderExtension/fetchThumbnails(for:requestedSize:perThumbnailCompletionHandler:completionHandler:))

Fetches the thumbnails for items that have been enumerated by the file provider.

### Working with services

[`supportedServiceSources(for:)`](/documentation/FileProvider/NSFileProviderExtension/supportedServiceSources(for:))

Return an array of service sources that let the host app perform actions associated with the specified item.

[`NSFileProviderServiceSource`](/documentation/FileProvider/NSFileProviderServiceSource)

A service that provides a custom communication channel between the host app and the File Provider extension.

### Managing placeholders

These methods have been deprecated and moved to the [`NSFileProviderManager`](/documentation/FileProvider/NSFileProviderManager)

A manager object that you use to communicate with the file provider from either your app or your File Provider extension. class.

[`placeholderURL(for:)`](/documentation/FileProvider/NSFileProviderExtension/placeholderURL(for:))

Returns a placeholder URL for a given document URL.

[`writePlaceholder(at:withMetadata:)`](/documentation/FileProvider/NSFileProviderExtension/writePlaceholder(at:withMetadata:))

Writes a document placeholder with the provided metadata.

### Accessing the document storage

These methods have been deprecated and moved to the [`NSFileProviderManager`](/documentation/FileProvider/NSFileProviderManager)

A manager object that you use to communicate with the file provider from either your app or your File Provider extension. class.

[`documentStorageURL`](/documentation/FileProvider/NSFileProviderExtension/documentStorageURL)

The root URL for all shared documents.

[`providerIdentifier`](/documentation/FileProvider/NSFileProviderExtension/providerIdentifier)

A purpose identifier for coordinated reads and writes.



---

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)