<!--
{
  "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

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

Returns a unique identifier for the given URL.

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

Returns the URL for a given persistent identifier.

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

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

[`-  enumeratorForContainerItemIdentifier:error:`](/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

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

Tells the File Provider extension that a document has changed.

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

Triggers the creation of a placeholder for the given URL.

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

Provides an actual file on disk for a placeholder.

[`-  stopProvidingItemAtURL:`](/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.

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

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

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

Permanently deletes an item from the trash.

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

Imports a file or package into the given parent directory.

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

Renames a document or directory.

[`-  reparentItemWithIdentifier: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.

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

Moves an item into the trash.

[`-  untrashItemWithIdentifier: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

[`-  fetchThumbnailsForItemIdentifiers: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

[`-  supportedServiceSourcesForItemIdentifier:error:`](/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.

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

Returns a placeholder URL for a given document URL.

[`+  writePlaceholderAtURL:withMetadata:error:`](/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.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

---

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)