在文本编辑器中编写的Swift脚本可以用xcrun swift hello_world.swift或swift hello_world.swift执行。这与Python这样的脚本语言是并行的。
但是由于Swift是一种编译语言,我确信必须有某种方法通过终端使用swift、clang等构建Swift可执行文件。令人惊讶的是我什么也没发现。
当我在Xcode8中打开我的项目时,我得到以下错误
Use Legacy Swift Language Version” (SWIFT_VERSION) is required to be configuredcorrectly for targets which use Swift.Use the [Edit > Convert > To Current Swift Syntax…] menu to choose a Swift version or use the Build Settin