title: Is there a way not to show a window for a SwiftUI-lifecycle macOS app?
body: <p>I'm looking to not show a window for a SwiftUI application on macOS. The app uses SwiftUI's application lifecycle and only runs in the status bar. Showing a window on start up is unnecessary. I'm unsure however how to get around the <code>WindowGroup</code>. There's no such a thing as an <code>EmptyScene</code> and putting an <code>EmptyView</code> inside the <code>WindowGroup</code> of course creates an empty window.</p>
  <pre class="lang-swift prettyprint-override"><code>@main
  struct MyApp: App {
      @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate
  
      var body: some Scene {
          WindowGroup {
              ContentView()
          }
      }
  }
  </code></pre>
  <p>I basically only need the app delegate. I'm guessing using the default AppKit lifecycle makes more sense, but if there is a way to use SwiftUI's lifecycle, I'd love to know.</p>