hasUnsavedChanges
A Boolean value that indicates whether the document has any unsaved changes.
Declaration
var hasUnsavedChanges: Bool { get }Return Value
Discussion
The default implementation of autosave(completionHandler:) initiates a save if this property returns true. Typical subclasses don’t need to override hasUnsavedChanges. To implement change tracking, they should instead use an UndoManager object (assigned to undoManager) to register changes or call updateChangeCount(_:) every time the user makes a change; UIKit then automatically determines whether there are unsaved changes.