Type Method


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


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



The URL of the file whose version you want.


The persistent ID of the NSFileVersion object you want.

Return Value

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

See Also

Getting the Version of a File

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

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

class func otherVersionsOfItem(at: URL) -> [NSFileVersion]?

Returns all versions of the specified file except the current version.

class func temporaryDirectoryURLForNewVersionOfItem(at: URL) -> URL

Creates and returns a temporary directory to use for saving the contents of the file.