3 ms·
What's weird, is that if you create a project to make/edit the script with Xcode, it needs to be named "main.swift" in order to execute from Xcode.
by bartvk 4y ago
What's weird, is that if you create a project to make/edit the script with Xcode, it needs to be named "main.swift" in order to execute from Xcode.
- jshier 4y agoYou either need main.swift, in which case you get global execution, or another file with a type marked `@main`, which encapsulates the main execution (and enables async support).
- bartvk 4y agoYeah but within Xcode, you cannot run another file marked with main. Well, you can but it can’t start with a shebang. https://stackoverflow.com/questions/73258896/swift-error-hashbang-line-is-allowed-only-in-the-main-file https://stackoverflow.com/questions/73258896/swift-error-has...