Type Property


Returns whether the receiving subclass of NSDocument supports Versions.


class var preservesVersions: Bool { get }

Return Value

true if the receiving subclass of NSDocument supports Versions; otherwise false.


The default implementation of this method returns [self autosavesInPlace]. You can override it and return false to declare that NSDocument should not preserve old document versions.

Returning false from this method disables version browsing and revertToSaved(_:), which rely on version preservation when autosaving in place. Returning true from this method when autosavesInPlace returns false will result in undefined behavior.

See Also


func checkAutosavingSafety()

Returns a Boolean value indicating whether it is probably safe to autosave document changes.

func scheduleAutosaving()

Schedules periodic autosaving for the purpose of crash protection.

var hasUnautosavedChanges: Bool

A Boolean value indicating whether the document has changes that have not been autosaved.

func autosave(withImplicitCancellability: Bool, completionHandler: (Error?) -> Void)

Autosaves the document’s contents at an appropriate location if it needs autosaving.

class var autosavesInPlace: Bool

Returns whether the receiver supports autosaving in place.

class var autosavesDrafts: Bool

Returns whether the receiving subclass of NSDocument supports autosaving of drafts.

func browseVersions(Any?)

Opens the Versions browser in the document’s main window.

var autosavingFileType: String?

Returns the document type that should be used for an autosave operation.

var autosavingIsImplicitlyCancellable: Bool

A Boolean value indicating whether autosaving is happening now but could be safely cancelled.

var autosavedContentsFileURL: URL?

The location of the most recently autosaved document contents.