Yes, any iOS SDK allows you to develop previous versions of the OS. For example, you can develop for iOS5 even with the iOS6 SDK.
You just need to set Deployment Target to 5.1.
You can:
- use only the methods available in iOS5.1, and do not use any methods only for iOS6 to make sure that your application will still work in iOS5.1.
- or perform a run-time check every time you want to call a method that is available only in iOS6, and call this method only if it is available (if the user has his own iPhone with a fairly new version of iOS that supports this method) .
For more information and detailed instructions for configuration and sample cases, I highly recommend reading the SDK Compatibility Guide in the Apple documentation .
For example, if you want to provide a button to share something on social networks, you might want to use Social.framework, but this one is only available on iOS6. Thus, you can offer this feature to iOS6 users and alert iOS5 users that they need to upgrade their iPhone to iOS6 in order to use this specific feature:
// Always test the availability of a class/method/... to use // instead of comparing the system version or whatever other method, see doc if ([SLComposeViewController class]) { // Only true if the class exists, so the framework is available we can use the class SLComposeViewController* composer = [composeViewControllerForServiceType:SLServiceTypeFacebook]; // ... then present the composer, etc and handle everything to manage this } else { UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Sharing unavailable" message:@"You need to upgrade to iOS6 to be able to use this feature!" delegate:nil cancelButtonTitle:nil otherButtonTitles:@"OK, will do!"]; [alert show]; [alert release]; }
Then simply unlink the Social.framework link (change the Required parameter to Optional when you add the framework to the linker assembly steps), as described in detail in the documentation.
source share