Sent by the application to the delegate prior to default behavior to reopen (
- macOS 10.0+
The application object.
Indicates whether the
NSApplicationobject found any visible windows in your application. You can use this value as an indication of whether the application would do anything if you return
YES if you want the application to perform its normal tasks or
NO if you want the application to do nothing.
These events are sent whenever the Finder reactivates an already running application because someone double-clicked it again or used the dock to activate it.
By default the Application Kit will handle this event by checking whether there are any visible
NSPanel) objects, and, if there are none, it goes through the standard untitled document creation (the same as it does if
the is launched without any document to open). For most document-based applications, an untitled document will be created.
The application delegate will also get a chance to respond to the normal untitled document delegate methods. If you implement this method in your application delegate, it will be called before any of the default behavior happens. If you return
NSApplication will proceed as normal. If you return
NSApplication will do nothing. So, you can either implement this method with a version that does nothing, and return
NO if you do not want anything to happen at all (not recommended), or you can implement this method, handle the event yourself in some custom way, and return
Miniaturized windows, windows in the Dock, are considered visible by this method, and cause
flag to return
YES, despite the fact that miniaturized windows return
NO when sent an