Tells the delegate that the window is about to close.
On This Page
optional func windowWillClose(_ notification: Notification)
A notification named willCloseNotification.
You can retrieve the NSWindow object in question by sending object to notification.
func windowShouldClose(NSWindow) -> Bool
Tells the delegate that the user has attempted to close a window or the window has received a performClose(_:) message.