Instance Method


Update the change counter by indicating the kind of change.


func updateChangeCount(_ change: UIDocument.ChangeKind)



A constant that indicates whether a change has been made, cleared, undone, or redone. See UIDocument.ChangeKind for more information.


Calling this method can affect the value returned by hasUnsavedChanges. You should not need to call method this if you access an UndoManager object from the undoManager property (or assign a custom one to it) and register changes with the undo manager.

See Also

Tracking Changes and Autosaving

var hasUnsavedChanges: Bool

Returns whether the document has any unsaved changes.

var undoManager: UndoManager!

The undo manager for the document.

func changeCountToken(for: UIDocument.SaveOperation) -> Any

Overridden to return a change token for a specific save operation.

func updateChangeCount(withToken: Any, for: UIDocument.SaveOperation)

Overridden to update the change count with reference to a change-count token passed in by UIKit.

func autosave(completionHandler: ((Bool) -> Void)?)

Called by UIKit to initiate automatic saving of documents with unsaved changes.