Search code examples
iosversionitunes

Dropping iOS 4 support


I have an app that currently works well on iOS4-6. However, I would like to make use of newer libraries that only support 5 and above. What are the ramifications of dropping an OS version? How do the people on iOS4 backup their apps? Should I tell them to backup up the IPA file from iTunes? I know I have been in a few situations when I needed a file for an older iOS version and couldn't get the file back.

If you had to drop an iOS version, what would you do?


Solution

  • If you want to drop support for iOS 4, ramifications can be multiple and surely some user will be caught in what you described as "needing a file that you could not get back".

    In any case, I think that telling your users to backup the app data and the IPA file is a good strategy (you might devise another one, like the one suggested by @benzado, but the one you are proposing will work for sure, even in the case that the user decides to update the app through iTunes) to reduce the risk.

    The only thing that I do not know is how you are going to tell them to do so. Maybe through an intermediate release saying: this is the last one for iOS4? Not sure.

    On the other hand, I am not sure you really need to drop support for iOS4.

    Have a look at this post for a general approach.

    If you are just thinking of adding a new frameworks (existing for iOS5/6 and not for iOS4) it is just a matter of weak-linking those frameworks and then conditionally including the headers for those frameworks.

    Say that you want to support Twitter; then you conditionally include the headers:

    #if defined(__IPHONE_5_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_5_0
    #import <Twitter/Twitter.h>
    #import <Accounts/Accounts.h>
    #endif
    

    and also conditionally guard the use of Twitter methods:

    Class tweeterClass = NSClassFromString(@"TWTweetComposeViewController");
    if (tweeterClass != nil && [tweeterClass respondsToSelector:@selector(canSendTweet)]) {
       ...
    }
    

    (this code will only be executed on iOS5/6).

    As to weak-linking, go to your target options, display the build phases and there you can add the new frameworks under "link with frameworks"; only ensure that you select the option "optional" on the right side (see picture).

    enter image description here