Skip to content

Commit 9f3d69a

Browse files
Add new iPad Pro and iPhone SE 2 devices
1 parent 5ed0c37 commit 9f3d69a

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
A µframework to detect the device model provided through an extension of `UIDevice`. It also allows detection of the simulator and the device model it is simulating.
44

5+
Device identifier information sourced from [the iPhone wiki](https://www.theiphonewiki.com/wiki/Models) and limited to devices that are supported by the target versions.
6+
57
## Installation
68

79
### Swift Package Manager

Sources/UIDeviceModel/UIDeviceModel.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ public enum UIDeviceModel {
2121
case iPadPro9Inch
2222
case iPadPro10Inch
2323
case iPadPro11Inch
24+
case iPadPro11Inch2
2425
case iPadPro12Inch
2526
case iPadPro12Inch2
2627
case iPadPro12Inch3
28+
case iPadPro12Inch4
2729
case iPadMini
2830
case iPadMini2
2931
case iPadMini3
@@ -54,6 +56,7 @@ public enum UIDeviceModel {
5456
case iPhone11
5557
case iPhone11Pro
5658
case iPhone11ProMax
59+
case iPhoneSE2
5760

5861
case iPodTouch
5962
case iPodTouch2
@@ -120,6 +123,8 @@ extension UIDeviceModel {
120123
case "iPad7,5", "iPad7,6": return .iPad6
121124
case "iPad8,1", "iPad8,2", "iPad8,3", "iPad8,4": return .iPadPro11Inch
122125
case "iPad8,5", "iPad8,6", "iPad8,7", "iPad8,8": return .iPadPro12Inch3
126+
case "iPad8,9", "iPad8,10": return .iPadPro11Inch2
127+
case "iPad8,11", "iPad8,12": return .iPadPro12Inch4
123128
case "iPad11,1", "iPad11,2": return .iPadMini5
124129
case "iPad11,3", "iPad11,4": return .iPadAir3
125130

@@ -147,6 +152,7 @@ extension UIDeviceModel {
147152
case "iPhone12,1": return .iPhone11
148153
case "iPhone12,3": return .iPhone11Pro
149154
case "iPhone12,5": return .iPhone11ProMax
155+
case "iPhone12,8": return .iPhoneSE2
150156

151157
case "iPod1,1": return .iPodTouch
152158
case "iPod2,1": return .iPodTouch2

0 commit comments

Comments
 (0)