---
title: purposeIdentifier
framework: foundation
role: symbol
role_heading: Instance Property
path: foundation/nsfilecoordinator/purposeidentifier
---

# purposeIdentifier

A string that uniquely identifies the file access that was performed by this file coordinator.

## Declaration

```swift
var purposeIdentifier: String { get set }
```

## Discussion

Discussion Coordinated reads and writes performed using the same purpose identifier never block each other, even if they occur in different processes. If you are coordinating file access on behalf of a file presenter, use init(filePresenter:) and do not attempt to set a custom purpose identifier. Every file coordinator instance initialized with the same file presenter has the same purpose identifier. You may need to set a custom purpose identifier for the following reasons: Your application has a File Provider extension. Any file coordination done on behalf of the File Provider needs to be done using the File Provider’s purpose identifier. You have two separate subsystems that need to work together to perform a single high-level operation, and both subsystems perform their own coordinated reads or writes. Using the same purpose identifier in both subsystems prevents possible deadlocks between the two subsystems. When creating custom purpose identifiers, you can use a reverse DNS style string, such as com.example.MyApplication.MyPurpose, or a UUID string. You cannot use nil or zero-length strings. note: You can set a purpose identifier only once, either implicitly by calling init(filePresenter:) or explicitly using this property. Attempting to set the purpose identifier a second time throws an exception.

## See Also

### Managing File Presenters

- [addFilePresenter(_:)](foundation/nsfilecoordinator/addfilepresenter(_:).md)
- [removeFilePresenter(_:)](foundation/nsfilecoordinator/removefilepresenter(_:).md)
- [filePresenters](foundation/nsfilecoordinator/filepresenters.md)
