Instance Property


The undo manager for the document.


var undoManager: UndoManager! { get set }


This property holds the document's undo manager (an UndoManager object). Accessing this property lazily creates a default undo manager if a custom undo manager has not been set.

The undo manager for the document is registered as an observer of various UndoManager notifications so that it can call updateChangeCount(_:) as the user makes undoable changes to the document. When a subclass sets this property and implements registers changes with it, it does not need to call updateChangeCount(_:) directly or (more rarely) override hasUnsavedChanges.