苹果设备的相关判断

一、判断设备

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

你可能感兴趣的:(苹果设备的相关判断)