xcode Swift 2.0 最低系统版本要求(部署目标)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30825638/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 07:17:42  来源:igfitidea点击:

Swift 2.0 minimum system version requirement (deployment target)

iosxcodemacosswift

提问by CarmeloS

So Swift 2.0 is coming up with Xcode 7, what is the minimum iOS / OS X system version required to use Swift 2.0?

那么 Swift 2.0 即将推出 Xcode 7,使用 Swift 2.0 所需的最低 iOS / OS X 系统版本是多少?

采纳答案by Joshua Nozzi

An Apple staffer had this to say:

一位 Apple 员工曾这样说

iOS 7 / OS X 10.9, same as Swift 1.0.

iOS 7 / OS X 10.9,与 Swift 1.0 相同。

Update: I'm guessing this is because the runtime is packaged into the built app / library / framework / whatever the same as with Swift 1.x.

更新:我猜这是因为运行时被打包到构建的应用程序/库/框架/与 Swift 1.x 相同的任何内容中。

回答by David Wong

I've tested it as far a iOS 7, no clue on anything lower however you probably shouldn't be supporting iOS 6 anymore.

我已经在 iOS 7 上对其进行了测试,没有任何更低的线索,但是您可能不再支持 iOS 6。

回答by yood

I couldn't find an official response anywhere, but they implied that Swift 2.0 will deploy back to iOS 7 in a couple of WWDC 2015 presentations.

我在任何地方都找不到官方回应,但他们暗示 Swift 2.0 将在 WWDC 2015 的几个演示文稿中部署回 iOS 7。

  1. Session 403: Improving Your Existing Apps with Swift (http://asciiwwdc.com/2015/sessions/403), where they mention the availability feature in Swift 2.0:
  1. 会话 403:使用 Swift 改进您现有的应用程序 ( http://asciiwwdc.com/2015/sessions/403),他们提到了 Swift 2.0 中的可用性功能:

Because they all want you to support these old versions, iOS 7, 8, and now 9 is probably going to be on slate for this fall for many of you.

So to do that, we have this new availability feature introduced in Swift 2.0.

So as long as you are writing some code in Swift 2.0, we have a great way to check to see what SDK you are on and if you can actually use this feature or not.

因为他们都希望您支持这些旧版本,所以对于你们中的许多人来说,iOS 7、8 和现在的 9 可能会在今年秋天推出。

为此,我们在 Swift 2.0 中引入了这个新的可用性功能。

因此,只要您在 Swift 2.0 中编写一些代码,我们就有一个很好的方法来检查您使用的是什么 SDK,以及您是否可以实际使用此功能。

  1. Session 411: Swift in Practice (http://asciiwwdc.com/2015/sessions/411), where they talk about the Swift 2.0 availability feature:
  1. Session 411:Swift in Practice ( http://asciiwwdc.com/2015/sessions/411),他们讨论了 Swift 2.0 可用性功能:

But if I slide all the way back to deploying to iOS 7, the compiler can see, just as we can read on this slide, that it's unsafe to use this method, request when in use authorization. And the compiler will tell you that this is just unsafe code. And it's an error. It will literally prevent you from building this code. And it will give you a nice safety check.

但是如果我一直回到部署到 iOS 7,编译器可以看到,正如我们在这张幻灯片上看到的那样,使用这种方法是不安全的,在使用时请求授权。编译器会告诉你这只是不安全的代码。这是一个错误。它实际上会阻止您构建此代码。它会给你一个很好的安全检查。