Swift - 你如何决定最佳的“部署目标”?为您的iOS应用程序 [英] Swift - How do you DECIDE the optimal "Deployment Target" for your iOS app

查看:93
本文介绍了Swift - 你如何决定最佳的“部署目标”?为您的iOS应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Xcode上,您可以自己决定部署目标,但是您可以选择太旧的版本来稳定地运行应用程序,因为您的代码中的某些方法受到更高版本iOS的支持。
(例如选择部署目标8.0,但是当你在iOS版本8.0的设备上运行应用程序时,应用程序崩溃)

On Xcode, you can decide the "Deployment Target" by yourself, but you may choose too old version to run the app stably since some of methods in your code are supported by later version of iOS. (e.g. choose Deployment Target 8.0, but when you run the app on a device with iOS version 8.0, the app crashes)

有什么好方法可以决定最佳部署目标,或者可以扫描整个代码以了解iOS最低版本的一些工具?

Is there any good way to decide the best Deployment Target, or some tools which can scan the whole code to know the minimum version of iOS?

推荐答案

其实就是这样一个新功能 Xcode 7 Swift 2.0 从swift网站上看​​:

Thats actually a new feature of Xcode 7 and Swift 2.0 see from swift website:

Swift Apple

它在网站上声明,可用性


Swift 2.0内置可用性检查以便为每个目标操作系统版本轻松构建最佳应用程序。当使用对于最小目标操作系统来说太新的API时,编译器会给出错误

Swift 2.0 has built-in availability checking to make it easy to build the best possible app for each target OS version. The compiler will give you an error when using an API too new for your minimum target OS

这篇关于Swift - 你如何决定最佳的“部署目标”?为您的iOS应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆