美文网首页
iOS开发 - 写在.pch文件

iOS开发 - 写在.pch文件

作者: 菠萝吹雪xs | 来源:发表于2021-09-01 10:14 被阅读0次
//页面的宽高
#define ScrWidth [UIScreen mainScreen].bounds.size.width
#define ScrHeight [UIScreen mainScreen].bounds.size.height
//带有RGBA的颜色设置
#define COLOR(R, G, B, A) [UIColor colorWithRed:R/255.0 green:G/255.0 blue:B/255.0 alpha:A]
//16进制
#define  ColorWithHex(hex,alp) [UIColor colorWithRed:((float)((hex & 0xFF0000) >> 16)) / 255.0 \
green:((float)((hex & 0xFF00) >> 8)) / 255.0 \
blue:((float)(hex & 0xFF)) / 255.0 \
alpha:alp]
//判断ios系统
#define xsDeviceVersion [[[UIDevice currentDevice] systemVersion] floatValue]
//获取设备名称 例如:xinsun的手机
#define xsDeviceName  [[UIDevice currentDevice] name]
//获取系统名称 例如:iPhone OS
#define xsSysVersion  [[UIDevice currentDevice] systemName]
//获取设备唯一标识符 例如:FBF2306E-A0D8-4F4B-BDED-9333B627D3E6
#define xsDeviceUUID  [[[UIDevice currentDevice] identifierForVendor] UUIDString]
//获取设备的型号 例如:iPhone
#define xsDeviceModel  [[UIDevice currentDevice] model]




相关文章

网友评论

      本文标题:iOS开发 - 写在.pch文件

      本文链接:https://www.haomeiwen.com/subject/dtaaultx.html