Reputation: 3400
Similarly to apps like Microsoft Word and Garageband, I want have a dialog before my app is closed asking if the user wants to quit because there is unsaved content. With these apps, a small black dot appears in the close button on the window. Is there a way I can do this in Swift?
Upvotes: 1
Views: 184
Reputation: 72885
In Objective-C it's:
windowShouldClose:
...via NSWindowDelegate
You should be able to use this in Swift as well.
As for marking as edited, you want the setDocumentEdited:
method.
Upvotes: 1