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

# NSFileProviderDomain

A File Provider extension’s domain.

```
class NSFileProviderDomain
```

## Overview

You can use domains to partition a file provider’s content. When you use domains, a single file provider can act as if multiple file providers were installed, and users can dynamically switch from one domain to another. You can use domains to represent different accounts or locations.

By default, a File Provider extension has no domain. You can register domains by calling the [`NSFileProviderManager`](/documentation/FileProvider/NSFileProviderManager) class’s [`add(_:completionHandler:)`](/documentation/FileProvider/NSFileProviderManager/add(_:completionHandler:)) method. A new [`NSFileProviderExtension`](/documentation/FileProvider/NSFileProviderExtension) instance is created for each domain that you register. The [`NSFileProviderExtension`](/documentation/FileProvider/NSFileProviderExtension) object’s [`domain`](/documentation/FileProvider/NSFileProviderExtension/domain) property indicates which domain the file provider belongs to. Any items returned by that file provider also belong to the domain.

## Topics

### Creating domains

[`init(identifier:displayName:pathRelativeToDocumentStorage:)`](/documentation/FileProvider/NSFileProviderDomain/init(identifier:displayName:pathRelativeToDocumentStorage:))

Returns a newly instantiated domain.

[`init(identifier:displayName:)`](/documentation/FileProvider/NSFileProviderDomain/init(identifier:displayName:))

Creates a new file provider domain with the specified identifier and display name.

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

A unique identifier for a file provider’s domain.

[`init(displayName:userInfo:volumeURL:)`](/documentation/FileProvider/NSFileProviderDomain/init(displayName:userInfo:volumeURL:))

Creates a new file provider domain with the specified URL and display name.

### Accessing data

[`displayName`](/documentation/FileProvider/NSFileProviderDomain/displayName)

The name of the domain displayed in the user interface.

[`identifier`](/documentation/FileProvider/NSFileProviderDomain/identifier)

The domain’s unique identifier.

[`isReplicated`](/documentation/FileProvider/NSFileProviderDomain/isReplicated)

[`backingStoreIdentity`](/documentation/FileProvider/NSFileProviderDomain/backingStoreIdentity)

A unique identifier for the backing store used by the system.

[`pathRelativeToDocumentStorage`](/documentation/FileProvider/NSFileProviderDomain/pathRelativeToDocumentStorage)

The path of the domain’s subdirectory relative to the file provider’s shared container.

[`isHidden`](/documentation/FileProvider/NSFileProviderDomain/isHidden)

A Boolean value that determines whether the domain is visible to users.

[`userEnabled`](/documentation/FileProvider/NSFileProviderDomain/userEnabled)

A Boolean value that indicates whether the user has enabled or disabled the domain.

[`isDisconnected`](/documentation/FileProvider/NSFileProviderDomain/isDisconnected)

A Boolean value indicating that the domain is present, but disconnected from the file extension.

[`supportsSyncingTrash`](/documentation/FileProvider/NSFileProviderDomain/supportsSyncingTrash)

[`userInfo`](/documentation/FileProvider/NSFileProviderDomain/userInfo)

[`volumeUUID`](/documentation/FileProvider/NSFileProviderDomain/volumeUUID)

### Syncing Desktop and Documents folders

[`replicatedKnownFolders`](/documentation/FileProvider/NSFileProviderDomain/replicatedKnownFolders)

A list of known folders that the domain currently replicates.

[`supportedKnownFolders`](/documentation/FileProvider/NSFileProviderDomain/supportedKnownFolders)

A list of known folders that the domain can replicate.

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

Constants that identify known folders.

### Supporting search

[`supportsStringSearchRequest`](/documentation/FileProvider/NSFileProviderDomain/supportsStringSearchRequest)

A Boolean value that indicates whether the provider supports search.

### Testing

[`testingModes`](/documentation/FileProvider/NSFileProviderDomain/testingModes-swift.property)

A mode that gives the File Provider extension more control over the system’s behavior during testing.

[`NSFileProviderDomain.TestingModes`](/documentation/FileProvider/NSFileProviderDomain/TestingModes-swift.struct)

Modes that modify the system’s behavior while testing.



---

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)