How can I choose Swift compiler version

前端 未结 4 1120
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-11 11:40

I\'m using Xcode 7.3 but my project is in Swift 2.1. I don\'t want to update my codes right now. So how can I choose or download older version of Swift compiler? Many thanks

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-01-11 12:19

    If you're following the answers involving a .xctoolchain combined with Xcode 9 beta you'll encounter an error similar to this: :0: error: unknown argument: '-index-store-path' Command /Library/Developer/Toolchains/swift-3.1.1-RELEASE.xctoolchai‌​n/usr/bin/swiftc failed with exit code 1

    The reason is that Apple has added a new feature/argument, which hasn't made its way to open source Swift yet. You can get around this issue by launching Xcode from the command line with the feature disabled like this: /path/to/Xcode-beta.app/Contents/MacOS/Xcode -IDEIndexEnableBoltIndex NO

    Thanks to the Swift team

提交回复
热议问题