@@ -98,7 +98,8 @@ extension ScreenWrapper {
98
98
public enum Screen {
99
99
100
100
public static var isZoomedMode : Bool {
101
- UIScreen . main. scale != UIScreen . main. nativeScale
101
+ guard !isPlus else { return UIScreen . main. bounds. width == 375 }
102
+ return UIScreen . main. scale != UIScreen . main. nativeScale
102
103
}
103
104
104
105
static var size : CGSize {
@@ -123,6 +124,7 @@ public enum Screen {
123
124
case _428 = 428
124
125
125
126
public static var current : Width {
127
+ guard !isPlus else { return . _414 }
126
128
return Width ( rawValue: nativeSize. width / scale) ?? . unknown
127
129
}
128
130
}
@@ -139,6 +141,7 @@ public enum Screen {
139
141
case _926 = 926
140
142
141
143
public static var current : Height {
144
+ guard !isPlus else { return . _736 }
142
145
return Height ( rawValue: nativeSize. height / scale) ?? . unknown
143
146
}
144
147
}
@@ -156,6 +159,11 @@ public enum Screen {
156
159
case _6_7 = 6.7
157
160
158
161
public static var current : Inch {
162
+ guard !isPlus else {
163
+ // Plus 机型比较特殊 下面公式无法正确计算出尺寸
164
+ return . _5_5
165
+ }
166
+
159
167
switch ( nativeSize. width / scale, nativeSize. height / scale, scale) {
160
168
case ( 320 , 480 , 2 ) :
161
169
return . _3_5
@@ -200,6 +208,11 @@ public enum Screen {
200
208
case full
201
209
202
210
public static var current : Level {
211
+ guard !isPlus else {
212
+ // Plus 机型比较特殊 下面公式无法正确计算出尺寸
213
+ return . regular
214
+ }
215
+
203
216
switch ( nativeSize. width / scale, nativeSize. height / scale) {
204
217
case ( 320 , 480 ) :
205
218
return . compact
@@ -215,6 +228,10 @@ public enum Screen {
215
228
}
216
229
}
217
230
}
231
+
232
+ private static var isPlus : Bool {
233
+ return nativeSize. equalTo ( . init( width: 1080 , height: 1920 ) )
234
+ }
218
235
}
219
236
220
237
extension Screen {
0 commit comments