NSApplicationDelegate on Mac Catalyst

I'd like to handle it so that it doesn't quit even if I press the Dock Icon's "Quit menu" on Mac Catalyst.

Please let me know how to use the delegate func below on Mac Catalyst.

func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply 

There is currently no API that would allow you to prevent app termination on Mac Catalyst.

Please consider automatically saving your app state + using state restoration like you would on iOS. The app will transition to the background state during termination (from 00:27 onward), and you can use beginBackgroundTaskWithName / endBackgroundTask for last-second cleanup tasks, if necessary.

If your use case does not lend itself to this, please use Feedback Assistant to request new API.

You can not set your own NSApplicationDelegate on Mac Catalyst, as the one provided by the OS is central to much of the Mac Catalyst functionality. Only the UIApplicationDelegate is under your control.

NSApplicationDelegate on Mac Catalyst
 
 
Q