1
+ public extension DeviceModel {
2
+ static var allDevicesWithRoundedDisplayCorners : [ DeviceModel ] {
3
+ allCases. filter { $0. hasRoundedDisplayCorners }
4
+ }
5
+
6
+ var hasRoundedDisplayCorners : Bool {
7
+ switch self {
8
+ case . iPhone( . iPhoneXGlobal) ,
9
+ . iPhone( . iPhoneXGSM) ,
10
+ . iPhone( . iPhoneXS) ,
11
+ . iPhone( . iPhoneXSMax) ,
12
+ . iPhone( . iPhoneXR) ,
13
+ . iPhone( . iPhone11) ,
14
+ . iPhone( . iPhone11Pro) ,
15
+ . iPhone( . iPhone11ProMax) ,
16
+ . iPhone( . iPhone12Mini) ,
17
+ . iPhone( . iPhone12) ,
18
+ . iPhone( . iPhone12Pro) ,
19
+ . iPhone( . iPhone12ProMax) ,
20
+ . iPhone( . iPhone13Mini) ,
21
+ . iPhone( . iPhone13) ,
22
+ . iPhone( . iPhone13Pro) ,
23
+ . iPhone( . iPhone13ProMax) ,
24
+ . iPhone( . iPhone14) ,
25
+ . iPhone( . iPhone14Plus) ,
26
+ . iPhone( . iPhone14Pro) ,
27
+ . iPhone( . iPhone14ProMax) ,
28
+ . iPhone( . iPhone15) ,
29
+ . iPhone( . iPhone15Plus) ,
30
+ . iPhone( . iPhone15Pro) ,
31
+ . iPhone( . iPhone15ProMax) ,
32
+ . iPhone( . iPhone16) ,
33
+ . iPhone( . iPhone16Plus) ,
34
+ . iPhone( . iPhone16Pro) ,
35
+ . iPhone( . iPhone16ProMax) ,
36
+ . iPhone( . iPhone16e) ,
37
+ . iPad( . gen10Wifi) ,
38
+ . iPad( . gen10Cellular) ,
39
+ . iPad( . air4Wifi) ,
40
+ . iPad( . air4Cellular) ,
41
+ . iPad( . air5Wifi) ,
42
+ . iPad( . air5Cellular) ,
43
+ . iPad( . air11InchM2Wifi) ,
44
+ . iPad( . air11InchM2Cellular) ,
45
+ . iPad( . air13InchM2Wifi) ,
46
+ . iPad( . air13InchM2Cellular) ,
47
+ . iPad( . mini6Wifi) ,
48
+ . iPad( . mini6Cellular) ,
49
+ . iPad( . mini7Wifi) ,
50
+ . iPad( . mini7Cellular) ,
51
+ . iPad( . pro1_11inchWifi) ,
52
+ . iPad( . pro1_11inchWifiTera) ,
53
+ . iPad( . pro1_11inchCellular) ,
54
+ . iPad( . pro1_11inchCellularTera) ,
55
+ . iPad( . pro2_11inchWifi) ,
56
+ . iPad( . pro2_11inchCellular) ,
57
+ . iPad( . pro3_12d9inchWifi) ,
58
+ . iPad( . pro3_12d9inchWifiTera) ,
59
+ . iPad( . pro3_12d9inchCellular) ,
60
+ . iPad( . pro3_12d9inchCellularTera) ,
61
+ . iPad( . pro4_12d9inchWifi) ,
62
+ . iPad( . pro4_12d9inchCellular) ,
63
+ . iPad( . pro3_11inchWifi) ,
64
+ . iPad( . pro3_11inchWifiTera) ,
65
+ . iPad( . pro3_11inchCellular) ,
66
+ . iPad( . pro5_12d9inchWifi) ,
67
+ . iPad( . pro5_12d9inchCellular) ,
68
+ . iPad( . pro5_12d9inchCellularTera) ,
69
+ . iPad( . pro4_11inchWifi) ,
70
+ . iPad( . pro4_11inchCellular) ,
71
+ . iPad( . pro6_12d9inchWifi) ,
72
+ . iPad( . pro6_12d9inchCellular) ,
73
+ . iPad( . pro_11inchM4Wifi) ,
74
+ . iPad( . pro_11inchM4Cellular) ,
75
+ . iPad( . pro_13inchM4Wifi) ,
76
+ . iPad( . pro_13inchM4Cellular) ,
77
+ . mac( . iMac2PortsM1) ,
78
+ . mac( . iMac4PortsM1) ,
79
+ . mac( . iMac2PortsM3) ,
80
+ . mac( . iMac4PortsM3) ,
81
+ . mac( . iMac2PortsM4) ,
82
+ . mac( . iMac4PortsM4) ,
83
+ . mac( . macBookAir13InchM2) ,
84
+ . mac( . macBookAir15InchM2) ,
85
+ . mac( . macBookAir13InchM3) ,
86
+ . mac( . macBookAir15InchM3) ,
87
+ . mac( . macBookProM3) ,
88
+ . mac( . macBookProM4) ,
89
+ . mac( . macBookPro14InchM1Pro) ,
90
+ . mac( . macBookPro14InchM1Max) ,
91
+ . mac( . macBookPro16InchM1Pro) ,
92
+ . mac( . macBookPro16InchM1Max) ,
93
+ . mac( . macBookPro14InchM2Pro) ,
94
+ . mac( . macBookPro14InchM2Max) ,
95
+ . mac( . macBookPro16InchM2Pro) ,
96
+ . mac( . macBookPro16InchM2Max) ,
97
+ . mac( . macBookPro14InchM3Pro) ,
98
+ . mac( . macBookPro14InchM3Max14Core) ,
99
+ . mac( . macBookPro14InchM3Max16Core) ,
100
+ . mac( . macBookPro16InchM3Pro) ,
101
+ . mac( . macBookPro16InchM3Max14Core) ,
102
+ . mac( . macBookPro16InchM3Max16Core) ,
103
+ . mac( . macBookPro14InchM4Pro) ,
104
+ . mac( . macBookPro14InchM4Max) ,
105
+ . mac( . macBookPro16InchM4Pro) ,
106
+ . mac( . macBookPro16InchM4Max) :
107
+ return true
108
+
109
+ case . simulator( let model, _) :
110
+ return model. hasRoundedDisplayCorners
111
+
112
+ default :
113
+ return false
114
+ }
115
+ }
116
+
117
+ var hasDynamicIsland : Bool {
118
+ switch self {
119
+ case . iPhone( . iPhone14Pro) ,
120
+ . iPhone( . iPhone14ProMax) ,
121
+ . iPhone( . iPhone15) ,
122
+ . iPhone( . iPhone15Plus) ,
123
+ . iPhone( . iPhone15Pro) ,
124
+ . iPhone( . iPhone15ProMax) ,
125
+ . iPhone( . iPhone16) ,
126
+ . iPhone( . iPhone16Plus) ,
127
+ . iPhone( . iPhone16Pro) ,
128
+ . iPhone( . iPhone16ProMax) :
129
+ return true
130
+
131
+ case . simulator( let model, _) :
132
+ return model. hasDynamicIsland
133
+
134
+ default :
135
+ return false
136
+ }
137
+ }
138
+ }
0 commit comments