I.e., is it possible to know if my code is compiled under SDK 5.1, or 6.0, or any other version?
To find out the version number of each framework, navigate to the . framework file, locate and open the Info. plist file. If you are using an IDE (Integrated Development Environment), such as Xcode, look for the value for the key Bundle versions string.
The iOS SDK is a software development kit that helps developers create native applications for Apple's iOS devices and platforms. The iOS SDK was formerly known as the iPhone SDK.
The iOS SDK, combined with Xcode, helps developers write iOS applications using officially supported programming languages, including Swift and Objective-C. An . ipa (iOS App Store Package) file is an iOS application archive file which stores an iOS app.
The iOS SDK comprises all the libraries you need to write iOS apps, as well as the iOS Simulator for you to try out your apps on your Mac. The SDK is included with the Xcode tool, which is used for creating iOS and Mac applications.
#ifdef __IPHONE_6_0
// Will be ignored when compiled under SDK 5.1
#endif
When you are compiling under iOS SDK 5.1 or any other older SDK there is no #define for __IPHONE_6_0, so checking if the macro is defined helps to check the SDK version.
Take a look at the file "Availability.h
" and "AvailabilityInternal.h
" in the iOS SDK and you'll see conditionals that you may be able to make use of. The Apple OpenSource ones that I linked to (which I found in this closely related question) aren't the same ones that you'll find in your SDK.
For example, I see a define for "__IPHONE_OS_VERSION_MIN_REQUIRED
" and if you want to compile this code only on iOS 6 & newer, you'd make certain to have this set to "__IPHONE_6_0
".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With