I am building an OS X app in Swift:
(1) Run the app
(2) The app starts and the app icon appears in the dock.
(3) Clicking on the app icon in the dock <-- How can my app get notification for this action?
I hope to do something after the user click the app icon in the dock when the app is running. How to get notified for this action?
Implement
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool)
In your AppDelegate and make your application visible there.
See the documentation on more implementation details
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With