【问题标题】:Targeting older macOS versions using Swift 4使用 Swift 4 定位较旧的 macOS 版本
【发布时间】:2017-11-14 13:09:47
【问题描述】:

使用 Swift 4 (Xcode 9) 开发的应用可以运行的最早的 macOS 版本是什么?

【问题讨论】:

  • 不难发现:在Xcode中设置deployment target为10.6,然后build并阅读报错信息...

标签: swift macos swift4


【解决方案1】:

取决于您的要求。您也许可以在旧 macOS 版本上运行 Swift 4 本身(即工具链)以进行非 Xcode 开发。

如果您要问最旧的部署目标是什么,Swift 编译的应用程序将在最旧的 macOS 上运行,答案就在这里:

 https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/index.html

也就是说,Swift 可以部署回 macOS 10.9。

如果您要问在 Xcode 中运行 Swift 4 的最旧 macOS 是什么,您需要 Xcode 9,它需要在 10.12.4+ 上运行,这迫使您使用 SDK 10.13+。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2012-07-29
    • 2017-01-28
    • 1970-01-01
    • 2016-03-28
    • 2019-02-18
    • 1970-01-01
    • 2015-08-02
    相关资源
    最近更新 更多