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

# NSFileProviderDomainVersion

An opaque object that identifies a specific version of a domain.

```
class NSFileProviderDomainVersion
```

## Overview

The file provider extension is responsible for assigning and updating the domain version. To specify the domain version, adopt the [`NSFileProviderDomainState`](/documentation/FileProvider/NSFileProviderDomainState) protocol. The system then calls your extension’s [`domainVersion`](/documentation/FileProvider/NSFileProviderDomainState/domainVersion) method to read the current version.

The system reads the domain version after you call:

- The [`createItem(basedOn:fields:contents:options:request:completionHandler:)`](/documentation/FileProvider/NSFileProviderReplicatedExtension/createItem(basedOn:fields:contents:options:request:completionHandler:)) completion handler
- The [`modifyItem(_:baseVersion:changedFields:contents:options:request:completionHandler:)`](/documentation/FileProvider/NSFileProviderReplicatedExtension/modifyItem(_:baseVersion:changedFields:contents:options:request:completionHandler:)) completion handler
- The [`deleteItem(identifier:baseVersion:options:request:completionHandler:)`](/documentation/FileProvider/NSFileProviderReplicatedExtension/deleteItem(identifier:baseVersion:options:request:completionHandler:)) completion handler
- The [`item(for:request:completionHandler:)`](/documentation/FileProvider/NSFileProviderReplicatedExtension/item(for:request:completionHandler:)) completion handler
- The [`finishEnumerating(upTo:)`](/documentation/FileProvider/NSFileProviderEnumerationObserver/finishEnumerating(upTo:)) or [`finishEnumeratingWithError(_:)`](/documentation/FileProvider/NSFileProviderEnumerationObserver/finishEnumeratingWithError(_:)) method when enumerating the materialized set.

The system always reads the domain version on the same dispatch queue as the completion handler.

Your extension defines when the domain version changes. When you update the version, call the [`signalEnumerator(for:completionHandler:)`](/documentation/FileProvider/NSFileProviderManager/signalEnumerator(for:completionHandler:)) and passing the [`workingSet`](/documentation/FileProvider/NSFileProviderItemIdentifier/workingSet) constant as the `containerItemIdentifier` property. This notifies the system of the update. The system ignores any lower versions.

When the system discovers a change on disk, it associates that change with the current domain version. It then includes the version in the [`NSFileProviderRequest`](/documentation/FileProvider/NSFileProviderRequest) object passed to the file provider extension.

Only file provider extensions based on the [`NSFileProviderReplicatedExtension`](/documentation/FileProvider/NSFileProviderReplicatedExtension) use instances of this class. Each version object is immutable. You can use them as keys in a dictionary.

## Topics

### Creating Versions

[`next()`](/documentation/FileProvider/NSFileProviderDomainVersion/next())

Creates a new version that supersedes the current version.

### Comparing Versions

[`compare:`](/documentation/FileProvider/NSFileProviderDomainVersion/compare:)

Compares another domain version with this one.



---

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)