/SwiftUIShebang

A Hello World shebang script that opens a window with SwiftUI.

Primary LanguageSwift

SwiftUIShebang


This is a short-as-possible Swift shebang script that opens a window using SwiftUI.
No Xcode project, XIB or Storyboard. Just 42 lines of Swift.

I made this because I'm writing a command-line app that may on occasion want to open a native macOS window. I also wanted to see how easy this would be with SwiftUI. If anybody knows a way to do this in less lines of code, please let me know. Almost all of the 42 lines are just ripped from the boiler-plate code that Xcode gives you.