获取手机设备号及型号的宏

代码宏定义如下

 

//设备号
#define hUUID          [[UIDevice currentDevice].identifierForVendor.UUIDString stringByReplacingOccurrencesOfString:@"-" withString:@""]
//手机型号
#define hDeviceModel  [UIDevice currentDevice].model
//版本号获取
#define hAPPVersion    [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"]
//Build号获取
#define hAPPBuild      [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleVersion"]
//设备系统版本号
#define hDeviceVersion ([[UIDevice currentDevice] systemVersion])

#define hScreenWidth   [NSString stringWithFormat:@"%.1f",[[UIScreen mainScreen] bounds].size.width*[UIScreen mainScreen].scale]
#define hScreenHeight  [NSString stringWithFormat:@"%.1f",[[UIScreen mainScreen] bounds].size.height*[UIScreen mainScreen].scale]
//平台
#define hPlatform      @"iOS"

 

posted @ 2019-10-07 11:52  走路蹩脚的火星人  阅读(357)  评论(0编辑  收藏  举报