判断系统版本的另外一种方法:NSFoundationVersionNumber

    xiaoxiao2021-03-25  60

        //iOS10以上,floor:向下取整

        if(floor(NSFoundationVersionNumber) > NSFoundationVersionNumber_iOS_9_x_Max){

         

        }

        //iOS10以下

        else{

           

        }

    #if TARGET_OS_IPHONE

    #define NSFoundationVersionNumber_iPhoneOS_2_0 678.24

    #define NSFoundationVersionNumber_iPhoneOS_2_1  678.26

    #define NSFoundationVersionNumber_iPhoneOS_2_2  678.29

    #define NSFoundationVersionNumber_iPhoneOS_3_0  678.47

    #define NSFoundationVersionNumber_iPhoneOS_3_1  678.51

    #define NSFoundationVersionNumber_iPhoneOS_3_2  678.60

    #define NSFoundationVersionNumber_iOS_4_0  751.32

    #define NSFoundationVersionNumber_iOS_4_1  751.37

    #define NSFoundationVersionNumber_iOS_4_2  751.49

    #define NSFoundationVersionNumber_iOS_4_3  751.49

    #define NSFoundationVersionNumber_iOS_5_0  881.00

    #define NSFoundationVersionNumber_iOS_5_1  890.10

    #define NSFoundationVersionNumber_iOS_6_0  992.00

    #define NSFoundationVersionNumber_iOS_6_1  993.00

    #define NSFoundationVersionNumber_iOS_7_0 1047.20

    #define NSFoundationVersionNumber_iOS_7_1 1047.25

    #define NSFoundationVersionNumber_iOS_8_0 1140.11

    #define NSFoundationVersionNumber_iOS_8_1 1141.1

    #define NSFoundationVersionNumber_iOS_8_2 1142.14

    #define NSFoundationVersionNumber_iOS_8_3 1144.17

    #define NSFoundationVersionNumber_iOS_8_4 1144.17

    #define NSFoundationVersionNumber_iOS_8_x_Max 1199

    #define NSFoundationVersionNumber_iOS_9_0 1240.1

    #define NSFoundationVersionNumber_iOS_9_1 1241.14

    #define NSFoundationVersionNumber_iOS_9_2 1242.12

    #define NSFoundationVersionNumber_iOS_9_3 1242.12

    #define NSFoundationVersionNumber_iOS_9_4 1280.25

    #define NSFoundationVersionNumber_iOS_9_x_Max 1299

    #endif

    转载请注明原文地址: https://ju.6miu.com/read-38651.html

    最新回复(0)