Skip to content

Commit fec3bd2

Browse files
authored
Merge pull request #103 from Nirma/16e-iPad-Mini-Air
Add device models launched after October 2024
2 parents 48affad + 87e7fe7 commit fec3bd2

File tree

4 files changed

+98
-13
lines changed

4 files changed

+98
-13
lines changed

Sources/DeviceModel.swift

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,21 @@ public enum DeviceModel: CaseIterable {
4646
case iPhone15Pro, iPhone15ProMax
4747
case iPhone16, iPhone16Plus
4848
case iPhone16Pro, iPhone16ProMax
49+
case iPhone16e
50+
case iPhoneAir
51+
case iPhone17
52+
case iPhone17Pro, iPhone17ProMax
4953

5054
case iPadFirstGen, iPadSecondGen, iPadThirdGen, iPadFourthGen, iPadFifthGen, iPadSixthGen, iPadSeventhGen, iPadEighthGen, iPadNinthGen, iPadTenthGen
55+
case iPadA16
5156

5257
case iPadAir, iPadAir2, iPadAir3, iPadAir4, iPadAir5
5358

5459
case iPadAir11InchM2, iPadAir13InchM2
60+
case iPadAir11InchM3, iPadAir13InchM3
5561

5662
case iPadMini, iPadMini2, iPadMini3, iPadMini4, iPadMini5, iPadMini6
63+
case iPadMiniA17Pro
5764

5865
case iPadPro9_7Inch, iPadPro10_5Inch, iPadPro12_9Inch, iPadPro12_9Inch_SecondGen
5966

@@ -86,6 +93,9 @@ public enum DeviceModel: CaseIterable {
8693
case series9
8794
case ultra2
8895
case series10
96+
case series11
97+
case ultra3
98+
case se3
8999
#endif
90100

91101
case unknown
@@ -184,6 +194,13 @@ extension DeviceModel {
184194
case (17, 2): return .iPhone16ProMax
185195
case (17, 3): return .iPhone16
186196
case (17, 4): return .iPhone16Plus
197+
198+
case (17, 5): return .iPhone16e
199+
200+
case (18, 1): return .iPhone17Pro
201+
case (18, 2): return .iPhone17ProMax
202+
case (18, 3): return .iPhone17
203+
case (18, 4): return .iPhoneAir
187204

188205
default: return .unknown
189206
}
@@ -212,21 +229,26 @@ extension DeviceModel {
212229
case (11, 6), (11, 7): return .iPadEighthGen
213230
case (12, 1), (12, 2): return .iPadNinthGen
214231
case (13, 18), (13, 19): return .iPadTenthGen
232+
case (15, 7), (15, 8): return .iPadA16
233+
215234
case (4, 1), (4, 2), (4, 3): return .iPadAir
216235
case (5, 3), (5, 4): return .iPadAir2
217236
case (11, 3), (11, 4): return .iPadAir3
218237
case (13, 1), (13, 2): return .iPadAir4
219238
case (13, 16), (13, 17): return .iPadAir5
220-
case (14, 8), (14, 9):
221-
return .iPadAir11InchM2
222-
case (14, 10), (14, 11):
223-
return .iPadAir13InchM2
239+
case (14, 8), (14, 9): return .iPadAir11InchM2
240+
case (14, 10), (14, 11): return .iPadAir13InchM2
241+
case (15, 3), (15, 4): return .iPadAir11InchM3
242+
case (15, 5), (15, 6): return .iPadAir13InchM3
243+
224244
case (2, 5), (2, 6), (2, 7): return .iPadMini
225245
case (4, 4), (4, 5), (4, 6): return .iPadMini2
226246
case (4, 7), (4, 8), (4, 9): return .iPadMini3
227247
case (5, 1), (5, 2): return .iPadMini4
228248
case (11, 1), (11, 2): return .iPadMini5
229249
case (14, 1), (14, 2): return .iPadMini6
250+
case (16, 1), (16, 2): return .iPadMiniA17Pro
251+
230252
case (6, 3), (6, 4): return .iPadPro9_7Inch
231253
case (7, 3), (7, 4): return .iPadPro10_5Inch
232254
case (8, 1), (8, 2), (8, 3), (8, 4): return .iPadPro11Inch
@@ -302,6 +324,9 @@ extension DeviceModel {
302324
case (7, 1), (7, 2), (7, 3), (7, 4): return .series9
303325
case (7, 5): return .ultra2
304326
case (7, 8), (7, 9), (7, 10), (7, 11): return .series10
327+
case (7, 17), (7, 18), (7, 19), (7, 20): return .series11
328+
case (7, 12): return .ultra3
329+
case (7, 13), (7, 14), (7, 15), (7, 16): return .se3
305330
default: return .unknown
306331
}
307332
}
@@ -314,7 +339,6 @@ extension DeviceModel {
314339
extension DeviceModel {
315340
public var hasNotch: Bool {
316341
switch self {
317-
318342
case .iPhoneX, .iPhoneXS, .iPhoneXSMax, .iPhoneXR:
319343
return true
320344
case .iPhone11, .iPhone11Pro, .iPhone11ProMax:
@@ -325,7 +349,8 @@ extension DeviceModel {
325349
return true
326350
case .iPhone14, .iPhone14Plus:
327351
return true
328-
352+
case .iPhone16e:
353+
return true
329354
default:
330355
return false
331356
}
@@ -339,6 +364,8 @@ extension DeviceModel {
339364
return true
340365
case .iPhone16, .iPhone16Plus, .iPhone16Pro, .iPhone16ProMax:
341366
return true
367+
case .iPhone17, .iPhoneAir, .iPhone17Pro, .iPhone17ProMax:
368+
return true
342369
default:
343370
return false
344371
}

Sources/Identifier.swift

Lines changed: 51 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,18 @@ extension Identifier: CustomStringConvertible {
198198
return "iPhone 16 Pro"
199199
case (17, 2):
200200
return "iPhone 16 Pro Max"
201-
201+
202+
case (17, 5):
203+
return "iPhone 16e"
204+
205+
case (18, 3):
206+
return "iPhone 17"
207+
case (18, 4):
208+
return "iPhone Air"
209+
case (18, 1):
210+
return "iPhone 17 Pro"
211+
case (18, 2):
212+
return "iPhone 17 Pro Max"
202213

203214
default:
204215
return "unknown"
@@ -417,6 +428,27 @@ extension Identifier: CustomStringConvertible {
417428
case (16, 6):
418429
return "iPad Pro M4 (13 inch, Wi-Fi+5G)"
419430

431+
case (16, 1):
432+
return "iPad mini (A17 Pro, Wi-Fi)"
433+
case (16, 2):
434+
return "iPad mini (A17 Pro, Wi-Fi+5G)"
435+
436+
case (15, 7):
437+
return "iPad (A16, Wi-Fi)"
438+
case (15, 8):
439+
return "iPad (A16, Wi-Fi+5G)"
440+
441+
case (15, 3):
442+
return "iPad Air M3 (11 inch, Wi-Fi)"
443+
case (15, 4):
444+
return "iPad Air M3 (11 inch, Wi-Fi+5G)"
445+
case (15, 6):
446+
return "iPad Air M3 (13 inch, Wi-Fi)"
447+
case (15, 7):
448+
return "iPad Air M3 (13 inch, Wi-Fi+5G)"
449+
450+
451+
420452
default:
421453
return "unknown"
422454
}
@@ -520,6 +552,24 @@ extension Identifier: CustomStringConvertible {
520552
return "Apple Watch Series 10, 42mm case (GPS + Cellular)"
521553
case (7, 11):
522554
return "Apple Watch Series 10, 46mm case (GPS + Cellular)"
555+
case (7, 12):
556+
return "Apple Watch Ultra 3"
557+
case (7, 13):
558+
return "Apple Watch SE 3, 40mm case (GPS)"
559+
case (7, 14):
560+
return "Apple Watch SE 3, 44mm case (GPS)"
561+
case (7, 15):
562+
return "Apple Watch SE 3, 40mm case (GPS + Cellular)"
563+
case (7, 16):
564+
return "Apple Watch SE 3, 44mm case (GPS + Cellular)"
565+
case (7, 17):
566+
return "Apple Watch Series 11, 42mm case (GPS)"
567+
case (7, 18):
568+
return "Apple Watch Series 11, 46mm case (GPS)"
569+
case (7, 19):
570+
return "Apple Watch Series 11, 42mm case (GPS + Cellular)"
571+
case (7, 20):
572+
return "Apple Watch Series 11, 46mm case (GPS + Cellular)"
523573
default:
524574
return "unknown"
525575
}

Sources/Screen.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -128,19 +128,21 @@ extension Screen {
128128
case (1, 2), (2, 4), (2, 7), (3, 2), (3, 4): return .medium(mm: 42)
129129

130130
case (4, 1), (4, 3), (5, 1), (5, 3), (5, 9),
131-
(5, 11), (6, 1), (6, 3), (6, 10), (6, 12): return .small(mm: 40)
131+
(5, 11), (6, 1), (6, 3), (6, 10), (6, 12),
132+
(7, 13), (7, 15): return .small(mm: 40)
132133
case (4, 2), (4, 4), (5, 2), (5, 4), (5, 10),
133-
(5, 12), (6, 2), (6, 4), (6, 11), (6, 13): return .medium(mm: 44)
134+
(5, 12), (6, 2), (6, 4), (6, 11), (6, 13),
135+
(7, 14), (7, 16): return .medium(mm: 44)
134136

135137
case (6, 6), (6, 8), (6, 14), (6, 16),
136138
(7, 1), (7, 3): return .small(mm: 41)
137139
case (6, 7), (6, 9), (6, 15), (6, 17),
138140
(7, 2), (7, 4): return .medium(mm: 45)
139141

140-
case (6, 18), (7, 5): return .ultra(mm: 49)
142+
case (6, 18), (7, 5), (7, 12): return .ultra(mm: 49)
141143

142-
case (7, 8), (7, 10): return .small(mm: 42)
143-
case (7, 9), (7, 11): return .medium(mm: 46)
144+
case (7, 8), (7, 10), (7, 17), (7, 19): return .small(mm: 42)
145+
case (7, 9), (7, 11), (7, 18), (7, 20): return .medium(mm: 46)
144146

145147
default: return nil
146148
}

Tests/DeviceModelTests.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,11 @@ class DeviceModelTests: XCTestCase {
262262
XCTAssert(deviceModel == .iPhone16ProMax, "DeviceModel - .iPhone16ProMax is failing")
263263
}
264264

265+
func testDeviceModelIPhone16e() {
266+
let deviceModel = DeviceModel(identifier: Identifier("iPhone17,5"))
267+
XCTAssert(deviceModel == .iPhone16e, "DeviceModel - .iPhone16e is failing")
268+
}
269+
265270
// MARK: - iPad Device Model tests
266271

267272
func testDeviceModelIPadFirstGen() {
@@ -531,7 +536,8 @@ class DeviceModelTests: XCTestCase {
531536
.iPhone11, .iPhone11Pro, .iPhone11ProMax,
532537
.iPhone12, .iPhone12Pro, .iPhone12ProMax, .iPhone12mini,
533538
.iPhone13, .iPhone13mini, .iPhone13Pro, .iPhone13ProMax,
534-
.iPhone14, .iPhone14Plus]
539+
.iPhone14, .iPhone14Plus,
540+
.iPhone16e]
535541

536542
let noNotchModels: [DeviceModel] = DeviceModel.allCases.filter( { !notchModels.contains($0) })
537543

0 commit comments

Comments
 (0)