Instance Property

keepBackupFile

A Boolean value indicating whether the document keeps the backup files created before the document data is written to a file.

Declaration

var keepBackupFile: Bool { get }

Discussion

The default value of this property is false, which prevents the document from keeping backup files. Subclasses can override this property and return true from their implementation to have the document keep backup files.

See Also

Reading From and Writing to Files

func read(from: FileWrapper, ofType: String)

Sets the contents of this document by reading from a file wrapper of a specified type.

var fileModificationDate: Date?

The last known modification date of the document’s on-disk representation.

func runModalSavePanel(for: NSDocument.SaveOperationType, delegate: Any?, didSave: Selector?, contextInfo: UnsafeMutableRawPointer?)

Presents a modal Save panel to the user, then tries to save the document if the user approves the panel.

var shouldRunSavePanelWithAccessoryView: Bool

A Boolean value indicating whether the document’s Save panel displays a list of supported writable document types.

var backupFileURL: URL?

The URL for the document’s backup file that was created during an autosave operation.

var fileURL: URL?

The location of the document’s on-disk representation.

var isDraft: Bool

A Boolean value indicating whether the document is a draft that the user has not expressed an interest in keeping around.