I've got some code I want to only execute on the latest iPhone SDK (3.0), however I can't seem to figure out a way to target just 3.0 and ignore 2.2.1 etc. There is an ifdef statement, but it just seems to cover the entire iPhone:
#if TARGET_OS_IPHONE
Any help is appreciated.
Select pods from the drop-down menu. Build settings may be found by selecting each project and target and clicking on them. Change the iOS Deployment Target version from 8.0 to anything higher than 8.0 in the Deployment subsection (better to try the same project version).
Suggested approach: Unless you have specific needs, a safe answer is Apple's: “the current version minus 1.” Note that e-commerce companies – i.e., companies that rely on users buying things through their app – are more likely to support a wider range of deployment targets, because even if only 5% of their users are on ...
The minimum iOS version is the lowest iOS version supported by your app. Users running an older iOS version will not download newer updates of your app from the app store. The minimum iOS version can be set in the build settings under iOS Deployment Target. The same counts for macOS, tvOS, and watchOS.
That is the iOS deployment target or the minimum deployment target for iOS. It means that the application runs on any iOS device with iOS 14.3 or later installed. The values the dropdown menu lists depend on the version of Xcode you are using. Xcode 12, for example, no longer supports iOS 8.
You can use this #define to change what you build for each SDK...
#if __IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_2_2 // iPhone 3.0 code here #endif
And do this at run-time to run code for 3.0 and above:
float version = [[[UIDevice currentDevice] systemVersion] floatValue]; if (version >= 3.0) { // iPhone 3.0 code here }
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