Last active
June 1, 2024 05:13
-
-
Save fourplusone/f5ca1eb213cd548f5c0099da17dd0147 to your computer and use it in GitHub Desktop.
SwiftUI Command Line App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct MainApp : App { | |
var body: some Scene { | |
WindowGroup { | |
Text("Hello").padding() | |
} | |
} | |
} | |
DispatchQueue.main.async { | |
let app = NSApplication.shared | |
app.setActivationPolicy(.regular) | |
app.activate(ignoringOtherApps: true) | |
} | |
MainApp.main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment