|
14 | 14 | #import "TZAssetCell.h" |
15 | 15 | #import "UIView+Layout.h" |
16 | 16 | #import "TZImageManager.h" |
17 | | -#import <sys/utsname.h> |
18 | 17 |
|
19 | 18 | @interface TZImagePickerController () { |
20 | 19 | NSTimer *_timer; |
@@ -833,17 +832,10 @@ + (UIImage *)imageNamedFromMyBundle:(NSString *)name { |
833 | 832 | @implementation TZCommonTools |
834 | 833 |
|
835 | 834 | + (BOOL)tz_isIPhoneX { |
836 | | - struct utsname systemInfo; |
837 | | - uname(&systemInfo); |
838 | | - NSString *platform = [NSString stringWithCString:systemInfo.machine encoding:NSASCIIStringEncoding]; |
839 | | - if ([platform isEqualToString:@"i386"] || [platform isEqualToString:@"x86_64"]) { |
840 | | - // 模拟器下采用屏幕的高度来判断 |
841 | | - return (CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(375, 812)) || |
842 | | - CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(812, 375))); |
843 | | - } |
844 | | - // iPhone10,6是美版iPhoneX 感谢hegelsu指出:https://github.com/banchichen/TZImagePickerController/issues/635 |
845 | | - BOOL isIPhoneX = [platform isEqualToString:@"iPhone10,3"] || [platform isEqualToString:@"iPhone10,6"]; |
846 | | - return isIPhoneX; |
| 835 | + return (CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(375, 812)) || |
| 836 | + CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(812, 375)) || |
| 837 | + CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(414, 896)) || |
| 838 | + CGSizeEqualToSize([UIScreen mainScreen].bounds.size, CGSizeMake(896, 414))); |
847 | 839 | } |
848 | 840 |
|
849 | 841 | + (CGFloat)tz_statusBarHeight { |
|
0 commit comments