IOS 判断设备

mac2022-06-30  83

IOS 判断设备

//设备名称 return [UIDevice currentDevice].name;   //设备型号,只可得到是何设备,无法得到是第几代设备 return [UIDevice currentDevice].model;   //系统版本型号,如iPhone OS return [UIDevice currentDevice].systemVersion;   //系统版本名称,如6.1.3 return [UIDevice currentDevice].systemName; //判断是否为iPhone #define IS_IPHONE (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)   //判断是否为iPad #define IS_IPAD (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)   //判断是否为ipod #define IS_IPOD ([[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"])   //判断是否为iPhone5 #define IS_IPHONE_5_SCREEN [[UIScreen mainScreen] bounds].size.height >= 568.0f && [[UIScreen mainScreen] bounds].size.height < 1024.0f

转载于:https://www.cnblogs.com/sqintan/p/4744202.html

最新回复(0)