With the release of iOS 5 expected sometime in September is it time to drop support for 3.1.3 and only support 4.x and later? If so what version of iOS 4.x should you target as a minimum version?
Before deciding on which versions of iOS you should support it is worth reviewing what versions and software features will run on which device since some of the older devices cannot be updated beyond a certain release.
Latest Supported Versions
The original iPhone and the first generation iPod touch can only support up to iPhone OS 3.1.3. These devices never made the transition to iOS 4 so if you need to support these devices your minimum iOS level will have to be v3.1.3. If the List of iOS devices on Wikipedia is accurate the last of these devices was discontinued in September 2008. This means that by the time iOS 5 is released these devices will be 3 years old which is ancient for an iOS device.
The next dividing line comes with the iPhone 3G and the second generation iPod touch which can only support up to iOS 4.2.1. These devices were discontinued between mid 2009 and September 2010 which is pretty recent. This means that a fair number of these devices will still be in use.
Finally the remaining set of devices starting with the iPhone 3GS, iPhone 4, third and fourth generation iPod touch can all currently run iOS 4.3.3 which is the latest released version. They are also expected to support iOS 5 though it remains to be seen how well that will work on the 3GS and third generation iPod touch.
Supported iOS Features
Even though a device can support a certain version of iOS it does not mean it supports all the features of that version. So for example, the iPhone 3G can run iOS 4.2.1 but it does not support multitasking or the Game Center. For details on which iOS features are supported on which device refer to the following Apple articles:
Is it Time to Drop support for v3.1.3?
If you have an existing app it is getting very tempting to drop support for 3.1.3. The number of active devices that cannot be upgraded to at least 4.2.1 is getting smaller and smaller as a percentage of the overall device population. Ideally if you are thinking of dropping support for 3.1.3 you should try to survey your users and see how many are still on first generation devices. If you cannot do that you can get some idea by looking at statistics published by some of the more popular app developers. For example, Marco Arment of Instapaper fame recently published some iOS device and OS version stats which indicated that over 98% of his users were running at least iOS 4.0.
Once you decide to drop support for 3.1.3 the logical conclusion is to set your minimum target version to iOS 4.2. Any device capable of running 4.0 is also capable of being upgraded by the user to at least 4.2.x so it seems unnecessary to support anything less than that.
From an app developer viewpoint there are a number of advantages to dropping support for iPhone OS 3.1.3 when iOS 5 ships. The most obvious advantage is that you no longer need to test on 3.1.3 but I think the impact on the application code is even more significant. If you assume a minimum target level of iOS 4.2 you can drop any 3.x conditional code but also you can start to make use of features introduced in iOS 4.0 such as blocks and Grand Central Dispatch (GCD).
My feeling is that once iOS 5 goes live the minimum version required for most apps will rise to 4.2 (let me know in the comments if you plan to support something earlier and why). As always there can be no universal answer since a lot depends on what hardware and software features an app needs and what devices the majority of users of the app are running. I would find it hard to justify dropping support of 3.1.3 for an expensive paid app where more than 5-10% of the users were still on old hardware incapable of upgrading. On the other hand it is hard to justify the extra effort of supporting 3.1.3 for a free app with < 1% of users on old hardware.Where you draw the line is in the end up to you but I think the release of iOS 5 sometime in September is a good time to allow 3.1.3 to fade into the background.