简体   繁体   English

Swift App iOS兼容检查吗?

[英]Swift App iOS Compatible check?

I am now using Swift code for my whole project.And I need to know some backward compatibility. 我现在在整个项目中都使用Swift代码,而且我需要知道一些向后兼容性。

All 3rd party libraries that I used are iOS 8.0 and above.And some swift class(eg.UIAlertController,etc.) show me that it support iOS 8.0 or later which seem all swift project are recommended for iOS 8.0 or later.Not for iOS 7.0. 我使用的所有第3方库都是iOS 8.0或更高版本,并且一些swift类(例如UIAlertController等)向我展示了它支持iOS 8.0或更高版本,似乎所有Swift项目都推荐用于iOS 8.0或更高版本。 7.0。

So,any suggestion or should I set my minimum requirement to iOS 8.0 or later for my Swift App. 因此,对于我的Swift App,任何建议或我应该将最低要求设置为iOS 8.0或更高版本。

Note I'm writing in Feb 2016. iOS 9 came out in Sep 2015. 请注意,我正在写2016年2月的内容。iOS9是2015年9月发布的。

I'm doing a project where 8.3 is the minimum. 我正在做一个项目,最低要求是8.3。 If you look at this chart, it shows most people have gone to iOS 9 already when it came out in September. 如果您查看此图表,它表明9月份发布时,大多数人已经使用了iOS 9。

http://www.macobserver.com/tmo/article/ios-9-adoption-rate-hits-50-in-less-than-a-week-fastest-ever http://www.macobserver.com/tmo/article/ios-9-adoption-rate-hits-50-in-less-than-a-week-fastest-ever

So I'm guessing that 8% of people on 7 or lower has pretty much vanished now. 因此,我猜测7%或7岁以下的人几乎消失了。

Summa summarum: you're safe to put 8 as the minimum. 摘要:您可以放心地将8作为最小值。

As a mobile developer company, we advise our clients to develop their apps to support the platform versions that most devices run at that time. 作为一家移动开发公司,我们建议客户开发其应用程序,以支持当时大多数设备运行的平台版本。 For example, at the time of writing this answer, this is iOS 8+ for iOS (and maybe soon iOS 9) and ICS+ for Android. 例如,在编写此答案时,这是用于iOS的iOS 8+(可能很快是iOS 9)和用于Android的ICS +。 You may be missing a lot of new features and facing lots of additional problems to try to support an outdated OS for very few users. 您可能会缺少许多新功能,并面临许多其他问题,以尝试为很少的用户支持过时的OS。

Especially for an OS like iOS that mostly forces regular users to update to the latest OS, this decision is even easier. 特别是对于像iOS这样的操作系统,该操作系统通常会迫使普通用户更新到最新的操作系统,因此这一决定甚至更加容易。

If you have a very specific reason to support iOS 7; 如果您有非常特定的理由支持iOS 7, according to this Apple Dev Blog , Swift applications can run on iOS 7. In Swift 2, you can insert checks to relevant parts of your code to "do this if iOS 8+, do that if older". 根据此Apple Dev Blog的介绍 ,Swift应用程序可以在iOS 7上运行。在Swift 2中,您可以在代码的相关部分插入检查,以“如果iOS 8+则执行此操作,如果较旧则执行此操作”。

if #available(iOS 8) {
    // use library that supports iOS 8 and later
} else {
    // do the same thing in iOS 7 way or show sad face to the user
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM