/**
* 检测设备类型
*
* @param name @"iPhone","iPod",@"iPad"
*
* @return YES OR NO
*/
+ (BOOL)checkDevice:(NSString*)name
{
NSString* deviceType = [UIDevice currentDevice].model;
NSRange range = [deviceType rangeOfString:name];
return range.location != NSNotFound;
}
使用方式:
[self checkDevice:@"iPad"]