I wanted to ask how compatibility on different iOS operation systems works in iOS. For example If I develop an app on Xcode 9.2
and Swift 4
for iOS 11
, should it work on iOS 9
?
I am coming from Android background which you specify the minimum Android OS that is needed for the app to run in the Gradle file. Does anything similar exist on iOS?
Yes, it will work on iOS9 With Xcode 9.2 and swift4 you can develop an application for ios8.0 and above.
In your project setting, you have to select your development target
Please set your deployment target to 9.0
Yes, there is backward compatibility, but for older iOSes you have to check version when using newer API. Luckily we've got availability attributes (@available)
If you want to know HOW it works, basically for Swift your application has its own swift standard library embedded into binary of your application. In case of Objective C – newer iOSes keep sdk's of older versions to maintain backward compatibility.
Very simple solution:
Set deployment target as 9.0 in your build target general settings. iOS will automatically handle support from 9.0 onwards for a build (your app).
Your app/build will be allowed to use/import frameworks and other libraries, compatible to minimum deployment target, only.
More detail about App Deployment Target from Apple.