一、判斷設(shè)備
01
//設(shè)備名稱(chēng)
02
return [UIDevice currentDevice].name;
03
04
//設(shè)備型號(hào),只可得到是何設(shè)備,無(wú)法得到是第幾代設(shè)備
05
return [UIDevice currentDevice].model;
06
07
//系統(tǒng)版本型號(hào),如iPhone OS
08
return [UIDevice currentDevice].systemVersion;
09
10
//系統(tǒng)版本名稱(chēng),如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