How to check iOS version?

后端 未结 30 2972
一生所求
一生所求 2020-11-21 06:37

I want to check if the iOS version of the device is greater than 3.1.3 I tried things like:

[[UIDevice currentDevice].systemVersion         


        
30条回答
  •  轮回少年
    2020-11-21 07:17

    Using the refered recommended way... if there is no definition in the header files, you can always get the versión printing it on console with a device of the desired IOS versión.

    - (BOOL) isIOS8OrAbove{
        float version802 = 1140.109985;
        float version8= 1139.100000; // there is no def like NSFoundationVersionNumber_iOS_7_1 for ios 8 yet?
        NSLog(@"la version actual es [%f]", NSFoundationVersionNumber);
        if (NSFoundationVersionNumber >= version8){
            return true;
        }
        return false;
    }
    

提交回复
热议问题