Reputation: 615
I want to add new features of iOS8 to my iOS app, such as today widget, while still support all iOS 7 users of mine. In other words, the new version of the app is still working with iOS 7 while the new feature is enabled only on iOS 8.
As far as I can see, once I add a today widget, the deployment target of the project is being automatically switched to iOS 8, would that mean my existing iOS 7 user would not be able to upgrade their app to this new version?
Is that possible to support this scenario at all? Or will I have to drop all the iOS 7 user? I am also willing to go for an approach of publishing and maintaining two separate versions for different iOS 7 and 8, if that is possible.
Upvotes: 1
Views: 962
Reputation: 7537
There is no issue. Quoting apple documentation:
If you link to an embedded framework from your containing app, you can still deploy it to versions of iOS older than 8.0, even though embedded frameworks are not available in those versions.
As such, just change the deployment target to however low you want - it will run just fine on older iOSs, just without the widget.
Upvotes: 0
Reputation: 76
The today widget is a new target in your project, with a new, unique, bundle name. Its deployment target will indeed be iOS 8. But it is "embedded" in another target (specified when you create the new application extension target), whose deployment OS version will remain unchanged (6.0 or whatever). Your user downloads the new app, which will now consist of two bundles. If they don't have iOS 8, the new today widget bundle will be ignored.
Upvotes: 1
Reputation: 3182
Have you tried switching the deployment target back to iOS 7? I haven't seen anything that suggests you can only support iOS 8 if you have today extensions, but I haven't tried it specifically. Given that they are essentially a separate executable which is in a separate bundle to your main app there should be no reason for it not to work. WeatherPro and Kindle are both apps which have today extensions and run on iOS 7 & 8.
For background you may find this article helpful if you haven't seen it already: http://www.raywenderlich.com/42591/supporting-multiple-ios-versions-and-devices
Upvotes: 1
Reputation: 4277
You can use the following macros:
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 80000
// iOS 8 code here...
#endif
Only insert iOS 8 code inside this macros every time. Everything else should work the same.
While the minimum target is iOS 7 those users should still be able to run the updated up on the devices with iOS 7.
Upvotes: 1