Instance Property


The document’s undo manager object.


var undoManager: UndoManager? { get set }


When the hasUndoManager property is true, accessing this property creates an UndoManager before returning it. If the hasUndoManager property is false, the value of this property is nil by default. Assigning an undo manager to this property stores a reference to the object and automatically changes the hasUndoManager property to true.

Whether you assign an undo manager or let the document create one, the document registers itself as an observer of various UndoManager notifications so that appropriate document actions are stored on the undo stack.

See Also

Working with Undo Manager

var hasUndoManager: Bool

A Boolean value indicating whether the document owns or should own an undo manager object.

func updateChangeCount(NSDocument.ChangeType)

Updates the receiver’s change count according to the given change type.