---
title: "currentVersionOfItem(at:)"
framework: foundation
role: symbol
role_heading: Type Method
path: "foundation/nsfileversion/currentversionofitem(at:)"
---

# currentVersionOfItem(at:)

Returns the most recent version object for the file at the specified URL.

## Declaration

```swift
class func currentVersionOfItem(at url: URL) -> NSFileVersion?
```

## Parameters

- `url`: The URL of the file whose version object you want.

## Return Value

Return Value The version object representing the current version of the file or nil if there is no such file.

## See Also

### Getting the Version of a File

- [otherVersionsOfItem(at:)](foundation/nsfileversion/otherversionsofitem(at:).md)
- [version(itemAt:forPersistentIdentifier:)](foundation/nsfileversion/version(itemat:forpersistentidentifier:).md)
- [temporaryDirectoryURLForNewVersionOfItem(at:)](foundation/nsfileversion/temporarydirectoryurlfornewversionofitem(at:).md)
