Instance Method

updateChangeCount(_:)

Update the change counter by indicating the kind of change.

Declaration

func updateChangeCount(_ change: UIDocumentChangeKind)

Parameters

change

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

Discussion

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: UIDocumentSaveOperation)

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

func updateChangeCount(withToken: Any, for: UIDocumentSaveOperation)

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

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

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