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

    //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


评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值