Picking an iOS Version for Apps
You've got a great idea for an app, and now you're ready to get started developing it. Xcode creates your new project and oh so helpfully sets your supported version to whatever the very latest version of iOS is.
Is that really the version you should support? Well...it depends. There's no right or wrong answer. It's a trade-off between the number of users you support and the amount of improvements you can make by supporting a newer version.
The typical rule of thumb when working on a commercial app is to support the current version of iOS and either one or two versions before that. So if iOS is at 16.2, you might support iOS 14 and 15 as well. Once iOS 17 comes out, you would drop support for iOS 14.
But what if you're just developing this as a hobby or demo project? You might want to only support the most recent major version of iOS - for instance, 16, so that you can use the latest versions of the iOS APIs.
SwiftUI and UIKit Considerations
Choosing your minimum iOS version is much more important if you develop an app with SwiftUI - Apple has been improving and refining SwiftUI with every version of iOS, so starting with an older version of SwiftUI means giving up some nice features.
Working with UIKit and Storyboards, the improvements tend to be much smaller between iOS versions. Supporting older versions of iOS probably won't be as hard to do.
Making Decisions with Numbers
Apple publishes numbers on the iOS adoption rates for devices connecting to the App Store.
You can take a look and see what the percentages are for updates.
Once you create your application, you can get the actual numbers for your users with tools like Firebase Analytics that collect this information. If you find out that 98% of your user base is on the latest major version of iOS, that may make it easier to decide to drop support for older versions.
You can also check App Store analytics for the iOS stats for your application.
Using New APIs and Staying Backwards Compatible
All is not lost if you decide to support older versions of iOS, and you want to include some of the new things that Apple announces every year for the new version.
You can use Swift's availability features to only run code if the app is runnning in a certain version of iOS or higher. On older versions of iOS, that code will be ignored.
Using Third Party Libraries
Another consideration is to check what versions of iOS your third party libraries support. Many have a similar rule of thumb for iOS support - only going back one or two major versions. Even if you would like to support iOS 13 with your app, if you need a third-party library or SDK, that may not be possible.
Wrapping Up
If you're creating this app for fun, feel free to support the latest iOS major version. For instance, if iOS is currently at 16.2, support 16.0. If you're looking to create a new app for an existing audience, try and support one or two versions back of iOS. If you already have an app, you can look at the analytics data to see what your audience is, and what would happen if you drop support for those versions.