Is it possible to make SwiftUI app with no windows on macOS 14?

I want to make an agent application in SwiftUI.

It would be setup as a login item and have no dock icon and display no windows on start.

I used AlertScene at first, but it is unavailable on macOS 14 which is my deployment target.

Is there a way to have no windows or I'd better use AppKit for that?

Answered by darkpaw in 849210022

I think you want to use something like SMAppService.

Are you saying you don't ever want a UI, or that no UI will be displayed when the app launches? So you'll still have some sort of Preferences UI somewhere? Then yes, use SwiftUI and Swift.

Investigate SMAppService.

Accepted Answer

I think you want to use something like SMAppService.

Are you saying you don't ever want a UI, or that no UI will be displayed when the app launches? So you'll still have some sort of Preferences UI somewhere? Then yes, use SwiftUI and Swift.

Investigate SMAppService.

Thank you for your response.

I was under the impression that it was required to have a scene inside the App body.

Your comment made me check, and it turns out the body can be empty. So it is my fault for not checking first.

And you are right, SMAppService works for my case.

Is it possible to make SwiftUI app with no windows on macOS 14?
 
 
Q