我创建了一个新项目并选择了 Cocoa App,然后按下一步,发现 Objective C 是唯一可用的语言。我点击了帮助| Xcode 菜单中有什么新功能,它说 swift 语言和 lang 支持是新功能。
这里出了什么问题?
更新:我从 Apple 网站更新了产品。尽管 Xcode 附带的文档说 Swift 是此版本的一部分,但为什么我不能使用 swift?顺便说一句,Xcode版本是:版本6.0(6A313)。
最佳答案
如 the Swift Blog 中所述:
Today is the GM date for Swift on iOS. We have one more GM date to go for Mac. Swift for OS X currently requires the SDK for OS X Yosemite, and when Yosemite ships later this fall, Swift will also be GM on the Mac. In the meantime, you can keep developing your Mac apps with Swift by downloading the beta of Xcode 6.1.
所以,您需要 Xcode 6.1,而不是 6.0。根据download page目前,6.1 可在 Yosemite Developer Preview 或 Mavericks 上运行。
关于Xcode 6 测试版 : I'm not able to select Swift as language,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25931469/