iOS:定位iOS 9时使用Swift 4 [英] iOS: Using Swift 4 when targeting iOS 9
问题描述
Swift 4添加了一些非常酷的功能,例如强类型化的键路径和 JSON编码/解码使用Codable
.
Swift 4 is adding some really cool features, like strongly typed keypaths and JSON encoding/decoding using Codable
.
我想在仍针对iOS 9及更高版本的情况下使用这些新功能.
I would like to use these new features while still targeting iOS 9 and above.
据我了解,Swift语言版本未绑定到iOS版本,例如,与Foundation框架相反.但是,如果正确,我找不到任何信息.
As far as I understand, Swift language version is not bound to a version of iOS, as opposite to Foundation framework, for example. However, I can't find any info if that's correct.
在将iOS定位为11之前的版本时,我可以使用Swift 4吗?
Can I use Swift 4 when targeting iOS older than 11?
推荐答案
是的,就像Swift 1,Swift 2和Swift 3一样,您可以在任何版本的iOS 7及更高版本上使用Swift 4 >.
Yes, just like with Swift 1, Swift 2 and Swift 3, you can use Swift 4 with any version of iOS 7 and above.
请参见Swift 3的类似问题: Swift 2.0最低系统版本要求(部署目标)
See this similar question for Swift 3: Xcode 8 / Swift 3 and installing apps on iPhone 4 running iOS 7
See this similar question for Swift 2: Swift 2.0 minimum system version requirement (deployment target)
注意:由于iOS 11放弃了对32位的支持,因此您将只能通过arm64 slice(即,从iPhone 5S及更高版本)使用iOS 11. 来源:
Note: as iOS 11 is dropping support for 32-bit, you will only be able to use iOS 11 from an arm64 slice (that is, from iPhone 5S and up). Source:
iOS 11不再支持armv7或armv7s(32位).如果iOS目标具有iOS部署 目标为11,则它将不会针对32位进行构建.具有较早的iOS部署目标的iOS目标 默认情况下,超过11的版本仍会针对32位进行构建. (32163517)
iOS 11 no longer supports armv7 or armv7s (32-bit). If an iOS target has an iOS Deployment Target of 11, then it will not build for 32-bit. iOS targets with an iOS Deployment Target earlier than 11 will still build for 32-bit by default. (32163517)
这篇关于iOS:定位iOS 9时使用Swift 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!