I'm building a music app for Mac using AppKit and Swift. I'm targeting macOS 11.0+.
When the app's last window is closed and then resigns active, my app is removed from the Dock, and terminated (when not attached to the debugger).
I'd like to stop this behaviour. When my app resigns active with no windows, it should remain in the Dock and continue running.
The current behaviour means that when music is playing, if the last window is closed (but not the app itself) and a user starts using a different app (e.g. Safari) the app is terminated. The expected behaviour would be to continue running and playing audio until the user explicitly quits the app.
I can't find this behaviour documented and can't find a way to fix this.
Thanks in advance for any help/pointers!
Notes:
My NSApplicationDelegate returns false for applicationShouldTerminateAfterLastWindowClosed
Post
Replies
Boosts
Views
Activity
I'm trying to put together an app intent that allows a user to navigate to a specific part of my app.
I've built a basic intent, and set up an AppEnum with a case for each "screen" in my app a user should be allowed to navigate to (e.g. "All Posts", "Favourite Posts", etc.).
In addition, I'd like to include additional parameters based on the enum selected. For example, I'd like to include an enum case "Post" where a user can configure a specific post to navigate to.
This would mean I can have an enum of "All Posts", "Specific Post", "Favourite Posts" etc. which is cleaner than having a separate intent for "Open Specific Post"...
Is this possible? I can see ParameterSummaryBuilder, AppIntent.Switch etc. but there are no docs or examples using these.
Can you provide more information on whether this is possible, and show an example of Swift code to do this.
Thanks!