ios判断当前设备是否是ipad
+ (BOOL)getIsIpad
{
NSString *deviceType = [UIDevice currentDevice].model;
if([deviceType isEqualToString:@"iPhone"]) {
//iPhone
return NO;
}
else if([deviceType isEqualToString:@"iPod touch"]) {
//iPod Touch
return NO;
}
else if([deviceType isEqualToString:@"iPad"]) {
//iPad
return YES;
}
return NO;
}
// 如果判断当前ui布局,ipad也可能返回iphone布局,则用如下方法
if ([[UIDevice currentDevice] userInterfaceIdiom] ==
UIUserInterfaceIdiomPad)
return YES;
else{
return NO;
}
原文链接:https://blog.csdn.net/feifeiwuxian/java/article/details/58298462