其他分享
首页 > 其他分享> > 获取手机设备号及型号的宏

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

作者:互联网

代码宏定义如下

 

//设备号
#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"

 

标签:UIScreen,版本号,UIDevice,currentDevice,获取,型号,手机,mainScreen,define
来源: https://www.cnblogs.com/110-913-1025/p/11629924.html