iOS小技巧 - 判断设备版本

来源:互联网 发布:vscode 修改字体颜色 编辑:程序博客网 时间:2024/05/19 08:41

[[UIDevice currentDevice].systemVersiondoubleValue] >= 7.0
在iOS版本过度的时候会用到设备版本的判断。

可将其定义为宏至pch文件中,这样整个项目都可以用。

如在Prefix.pch中加入以下代码:

 

#ifdef __OBJC__// 判断是否为iOS7.0以上#define iOS7 [[UIDevice currentDevice].systemVersion doubleValue] >= 7.0#endif


0 0
原创粉丝点击