---
title: "version(itemAt:forPersistentIdentifier:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/nsfileversion/version(itemat:forpersistentidentifier:)"
---

# version(itemAt:forPersistentIdentifier:)

Returns the version of the file that has the specified persistent ID.

## Declaration

```swift
class func version(itemAt url: URL, forPersistentIdentifier persistentIdentifier: Any) -> NSFileVersion?
```

## Parameters

- `url`: The URL of the file whose version you want.
- `persistentIdentifier`: The persistent ID of the NSFileVersion object you want.

## Return Value

Return Value The file version object with the specified ID or nil if no such version object exists.

## See Also

### Related Documentation

- [persistentIdentifier](foundation/nsfileversion/persistentidentifier.md)

### Getting the Version of a File

- [currentVersionOfItem(at:)](foundation/nsfileversion/currentversionofitem(at:).md)
- [otherVersionsOfItem(at:)](foundation/nsfileversion/otherversionsofitem(at:).md)
- [temporaryDirectoryURLForNewVersionOfItem(at:)](foundation/nsfileversion/temporarydirectoryurlfornewversionofitem(at:).md)
