The following question shows how to check the iOS version:
But what if I want to import a file only if the version is above a certain value ? I don't know of any macro for checking the iOS version.
The following question shows how to check the iOS version:
But what if I want to import a file only if the version is above a certain value ? I don't know of any macro for checking the iOS version.
#import
is a compile time step, so you can't wait until runtime to determine if you should import. The best you can do is import everything you might need, and then at runtime determine if you should use it.
Alternatively, you can build multiple apps, one for older versions of iOS and one for newer versions, each with different linker settings. If you want to explicitly target an older version of iOS with a different code base, you can get to that from the build settings of Xcode by selecting the root of the project in the left tree, and then changing Deployment Target
under the Deployment Info section.