I would like to detect iPhone OS version in the app, can you post sample code as well. I tried using macro that didn't help.
You need to use the macros if you want conditional compilation:
#if __IPHONE_8_0
// Works on >= version 8.0
#else
// Works on < version 8.0
#endif
Or alternatively, to check at runtime, use:
float ver = [[[UIDevice currentDevice] systemVersion] floatValue];
if (ver >= 8.0) {
// Only executes on version 8 or above.
}
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