@@ -100,6 +100,18 @@ public enum Device {
100100 ///
101101 /// 
102102 case iPhoneSE
103+ /// Device is an [iPhone 8](https://support.apple.com/kb/SP767)
104+ ///
105+ /// 
106+ case iPhone8
107+ /// Device is an [iPhone 8 Plus](https://support.apple.com/kb/SP768)
108+ ///
109+ /// 
110+ case iPhone8Plus
111+ /// Device is an [iPhone X](https://support.apple.com/kb/SP770)
112+ ///
113+ /// 
114+ case iPhoneX
103115 /// Device is an [iPad 2](https://support.apple.com/kb/SP622)
104116 ///
105117 /// 
@@ -213,6 +225,9 @@ public enum Device {
213225 case " iPhone9,1 " , " iPhone9,3 " : return iPhone7
214226 case " iPhone9,2 " , " iPhone9,4 " : return iPhone7Plus
215227 case " iPhone8,4 " : return iPhoneSE
228+ case " iPhone10,4 " : return iPhone8
229+ case " iPhone10,5 " : return iPhone8Plus
230+ case " iPhone10,3 " : return iPhoneX
216231 case " iPad2,1 " , " iPad2,2 " , " iPad2,3 " , " iPad2,4 " : return iPad2
217232 case " iPad3,1 " , " iPad3,2 " , " iPad3,3 " : return iPad3
218233 case " iPad3,4 " , " iPad3,5 " , " iPad3,6 " : return iPad4
@@ -247,7 +262,7 @@ public enum Device {
247262
248263 /// All iPhones
249264 public static var allPhones : [ Device ] {
250- return [ . iPhone4, . iPhone4s, . iPhone5, . iPhone5c, . iPhone5s, . iPhone6, . iPhone6Plus, . iPhone6s, . iPhone6sPlus, . iPhone7, . iPhone7Plus, . iPhoneSE]
265+ return [ . iPhone4, . iPhone4s, . iPhone5, . iPhone5c, . iPhone5s, . iPhone6, . iPhone6Plus, . iPhone6s, . iPhone6sPlus, . iPhone7, . iPhone7Plus, . iPhoneSE, . iPhone8 , . iPhone8Plus , . iPhoneX ]
251266 }
252267
253268 /// All iPads
@@ -317,6 +332,9 @@ public enum Device {
317332 case . iPhone7: return 4.7
318333 case . iPhone7Plus: return 5.5
319334 case . iPhoneSE: return 4
335+ case . iPhone8: return 4.7
336+ case . iPhone8Plus: return 5.5
337+ case . iPhoneX: return 5.8
320338 case . iPad2: return 9.7
321339 case . iPad3: return 9.7
322340 case . iPad4: return 9.7
@@ -353,6 +371,9 @@ public enum Device {
353371 case . iPhone7: return ( width: 9 , height: 16 )
354372 case . iPhone7Plus: return ( width: 9 , height: 16 )
355373 case . iPhoneSE: return ( width: 9 , height: 16 )
374+ case . iPhone8: return ( width: 9 , height: 16 )
375+ case . iPhone8Plus: return ( width: 9 , height: 16 )
376+ case . iPhoneX: return ( width: 9 , height: 19.5 )
356377 case . iPad2: return ( width: 3 , height: 4 )
357378 case . iPad3: return ( width: 3 , height: 4 )
358379 case . iPad4: return ( width: 3 , height: 4 )
@@ -404,7 +425,7 @@ public enum Device {
404425 ```
405426 switch Device() {
406427 case .iPodTouch5, .iPodTouch6: callMethodOnIPods()
407- case .iPhone4, iPhone4s, .iPhone5, .iPhone5s, .iPhone6, .iPhone6Plus, .iPhone6s, .iPhone6sPlus, .iPhone7, .iPhone7Plus, .iPhoneSE: callMethodOnIPhones()
428+ case .iPhone4, iPhone4s, .iPhone5, .iPhone5s, .iPhone6, .iPhone6Plus, .iPhone6s, .iPhone6sPlus, .iPhone7, .iPhone7Plus, .iPhoneSE, .iPhone8, .iPhone8Plus, .iPhoneX : callMethodOnIPhones()
408429 case .iPad2, .iPad3, .iPad4, .iPadAir, .iPadAir2, .iPadMini, .iPadMini2, .iPadMini3, .iPadMini4, .iPadPro: callMethodOnIPads()
409430 default: break
410431 }
@@ -473,6 +494,9 @@ public enum Device {
473494 case . iPhone7: return 326
474495 case . iPhone7Plus: return 401
475496 case . iPhoneSE: return 326
497+ case . iPhone8: return 326
498+ case . iPhone8Plus: return 401
499+ case . iPhoneX: return 458
476500 case . iPad2: return 132
477501 case . iPad3: return 264
478502 case . iPad4: return 264
@@ -517,6 +541,9 @@ extension Device: CustomStringConvertible {
517541 case . iPhone7: return " iPhone 7 "
518542 case . iPhone7Plus: return " iPhone 7 Plus "
519543 case . iPhoneSE: return " iPhone SE "
544+ case . iPhone8: return " iPhone 8 "
545+ case . iPhone8Plus: return " iPhone 8 Plus "
546+ case . iPhoneX: return " iPhone X "
520547 case . iPad2: return " iPad 2 "
521548 case . iPad3: return " iPad 3 "
522549 case . iPad4: return " iPad 4 "
0 commit comments