美文网首页
苹果设备的相关判断

苹果设备的相关判断

作者: Niklaus_8871 | 来源:发表于2018-04-23 16:28 被阅读0次

一、判断设备

01

//设备名称

02

return [UIDevice currentDevice].name;

03

04

//设备型号,只可得到是何设备,无法得到是第几代设备

05

return [UIDevice currentDevice].model;

06

07

//系统版本型号,如iPhone OS

08

return [UIDevice currentDevice].systemVersion;

09

10

//系统版本名称,如6.1.3

11

return [UIDevice currentDevice].systemName;

01

//判断是否为iPhone

02

#define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)

03

04

//判断是否为iPad

05

#define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)

06

07

//判断是否为ipod

08

#define IS_IPOD ([[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"])

09

10

//判断是否为iPhone5

11

#define IS_IPHONE_5_SCREEN [[UIScreen mainScreen] bounds].size.height >= 568.0f && [[UIScreen mainScreen] bounds].size.height < 1024.0f

相关文章

网友评论

      本文标题:苹果设备的相关判断

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