I would like my macOS app written in SwiftUI to handle a URL. And it just works.
@main
struct TheApp: App {
var body: some Scene {
WindowGroup {
Text("Hello world")
}
.handlesExternalEvents(matching: ["the-url-schema"])
}
}
However, it always shows the window once the URL is open. I could close it immediately, but then it appears for a second anyway. I need the window to stay closed until I really need it.