#import "sys/utsname.h"
+(BOOL)getIs_iPhoneX{
? ? structutsnamesystemInfo;
? ? uname(&systemInfo);
? ? NSString *platform = [NSString stringWithCString: systemInfo.machine encoding:NSASCIIStringEncoding];
? ? if([platformisEqualToString:@"i386"] || [platformisEqualToString:@"x86_64"]) {
? ? ? ? // 模擬器下采用屏幕的高度來判斷
? ? ? ? return(CGSizeEqualToSize([UIScreenmainScreen].bounds.size,CGSizeMake(375,812)) ||
? ? ? ? ? ? ? ? CGSizeEqualToSize([UIScreenmainScreen].bounds.size,CGSizeMake(812,375))||
? ? ? ? ? ? ? ? CGSizeEqualToSize([UIScreenmainScreen].bounds.size,CGSizeMake(414,896))||
? ? ? ? ? ? ? ? CGSizeEqualToSize([UIScreenmainScreen].bounds.size,CGSizeMake(896,414)));
? ? }
? ? //真機通過設(shè)備型號判斷
? ? return[platformisEqualToString:@"iPhone10,3"]|| [platformisEqualToString:@"iPhone10,6"] ||[platformisEqualToString:@"iPhone11,2"] || [platformisEqualToString:@"iPhone11,4"] ||[platformisEqualToString:@"iPhone11,6"] ||? [platformisEqualToString:@"iPhone11,8"] ;
}