Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I support multiple iOS versions?

Tags:

ios

iphone

So there´s quite a few versions of iOS up and running on devices now, and I´ve some questions on supporting the different kinds.

If I were to release an application know, wanting to use some features in iOS 6, but don´t want to lose the iOS 5 users, is it possible to target both versions within the same application that would be available on the App Store?

What is the other option here? To skip the iOS 6 features and just target iOS 5? Will the application have full support for iOS 6 in this case?

Thank you.

like image 372
marsrover Avatar asked Mar 02 '26 06:03

marsrover


1 Answers

iOS users upgrade faster than just about any other group. Unless you have a special user base, I do not recommend spending significant time supporting a version of iOS older than about 6 months. For many kinds of apps, even that is too long. Matt Gemmell wrote an excellent discussion of this when iOS 5 came out.

During your transition period, before you switch to the latest version, my recommendation is to build against the old SDK. Don't just set "Deployment Target." Set "Base SDK". This means you need to keep around the old SDKs and link them into your copy of Xcode because Apple will keep deleting them. Google around for how to build against old SDKs. There are lots of discussions. I'm sure there are tons on SO. There are several reasons I strongly recommend this (regardless of how long you wait to upgrade):

  • It is somewhat rare that you can actually provide a feature in the newest version that you don't in the old version. Most of the time you wind up having to provide it in the older version in some form. That means you now have two versions of the code doing basically the same thing. Most of the time the older way is harder, but still works. Once you've written the hard method, what's the point of also writing the easy method, and then writing the extra code to choose between them?

  • The testing required to swap features in and out is incredibly high. It's hard enough to test features in the first place. Now test that and test not having the feature.

  • The compiler gives you no help when you use "Development Target." If you call a method from iOS 6 without checking that it exists, then you will get no warning. You'll just crash on iOS 5. If you use Base SDK, then the compiler will tell you when it's not available. I spoke with the Xcode team at WWDC about this. They noted that Apple recommends using Deployment Target, but admitted it's insanely fragile to use in practice.

So basically, I say stay on the iOS 5 SDK until you're ready to go to iOS 6. Then go to the iOS 6 SDK and never look back.

like image 83
Rob Napier Avatar answered Mar 03 '26 20:03

Rob Napier



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!