@@ -13,102 +13,102 @@ import UIKit
13
13
extension UITraitCollection {
14
14
15
15
internal static func iPhone14( _ orientation: ViewImageConfig . Orientation ) -> UITraitCollection {
16
- let base : [ UITraitCollection ] = [
17
- UITraitCollection ( forceTouchCapability: . available) ,
18
- UITraitCollection ( layoutDirection: . leftToRight) ,
19
- UITraitCollection ( preferredContentSizeCategory: . medium) ,
20
- UITraitCollection ( userInterfaceIdiom: . phone)
21
- ]
22
- switch orientation {
23
- case . landscape:
24
- return UITraitCollection (
25
- traitsFrom: base + [
26
- UITraitCollection ( horizontalSizeClass: . regular) ,
27
- UITraitCollection ( verticalSizeClass: . compact)
28
- ]
29
- )
30
- case . portrait:
31
- return UITraitCollection (
32
- traitsFrom: base + [
33
- UITraitCollection ( horizontalSizeClass: . compact) ,
34
- UITraitCollection ( verticalSizeClass: . regular)
35
- ]
36
- )
37
- }
16
+ let base : [ UITraitCollection ] = [
17
+ UITraitCollection ( forceTouchCapability: . available) ,
18
+ UITraitCollection ( layoutDirection: . leftToRight) ,
19
+ UITraitCollection ( preferredContentSizeCategory: . medium) ,
20
+ UITraitCollection ( userInterfaceIdiom: . phone)
21
+ ]
22
+ switch orientation {
23
+ case . landscape:
24
+ return UITraitCollection (
25
+ traitsFrom: base + [
26
+ UITraitCollection ( horizontalSizeClass: . regular) ,
27
+ UITraitCollection ( verticalSizeClass: . compact)
28
+ ]
29
+ )
30
+ case . portrait:
31
+ return UITraitCollection (
32
+ traitsFrom: base + [
33
+ UITraitCollection ( horizontalSizeClass: . compact) ,
34
+ UITraitCollection ( verticalSizeClass: . regular)
35
+ ]
36
+ )
37
+ }
38
38
}
39
39
40
40
internal static func iPhone14Plus( _ orientation: ViewImageConfig . Orientation ) -> UITraitCollection {
41
- let base : [ UITraitCollection ] = [
42
- UITraitCollection ( forceTouchCapability: . available) ,
43
- UITraitCollection ( layoutDirection: . leftToRight) ,
44
- UITraitCollection ( preferredContentSizeCategory: . medium) ,
45
- UITraitCollection ( userInterfaceIdiom: . phone)
46
- ]
47
- switch orientation {
48
- case . landscape:
49
- return UITraitCollection (
50
- traitsFrom: base + [
51
- UITraitCollection ( horizontalSizeClass: . regular) ,
52
- UITraitCollection ( verticalSizeClass: . compact)
53
- ]
54
- )
55
- case . portrait:
56
- return UITraitCollection (
57
- traitsFrom: base + [
58
- UITraitCollection ( horizontalSizeClass: . compact) ,
59
- UITraitCollection ( verticalSizeClass: . regular)
60
- ]
61
- )
62
- }
41
+ let base : [ UITraitCollection ] = [
42
+ UITraitCollection ( forceTouchCapability: . available) ,
43
+ UITraitCollection ( layoutDirection: . leftToRight) ,
44
+ UITraitCollection ( preferredContentSizeCategory: . medium) ,
45
+ UITraitCollection ( userInterfaceIdiom: . phone)
46
+ ]
47
+ switch orientation {
48
+ case . landscape:
49
+ return UITraitCollection (
50
+ traitsFrom: base + [
51
+ UITraitCollection ( horizontalSizeClass: . regular) ,
52
+ UITraitCollection ( verticalSizeClass: . compact)
53
+ ]
54
+ )
55
+ case . portrait:
56
+ return UITraitCollection (
57
+ traitsFrom: base + [
58
+ UITraitCollection ( horizontalSizeClass: . compact) ,
59
+ UITraitCollection ( verticalSizeClass: . regular)
60
+ ]
61
+ )
62
+ }
63
63
}
64
64
65
65
internal static func iPhone14Pro( _ orientation: ViewImageConfig . Orientation ) -> UITraitCollection {
66
- let base : [ UITraitCollection ] = [
67
- UITraitCollection ( forceTouchCapability: . available) ,
68
- UITraitCollection ( layoutDirection: . leftToRight) ,
69
- UITraitCollection ( preferredContentSizeCategory: . medium) ,
70
- UITraitCollection ( userInterfaceIdiom: . phone)
71
- ]
72
- switch orientation {
73
- case . landscape:
74
- return UITraitCollection (
75
- traitsFrom: base + [
76
- UITraitCollection ( horizontalSizeClass: . regular) ,
77
- UITraitCollection ( verticalSizeClass: . compact)
78
- ]
79
- )
80
- case . portrait:
81
- return UITraitCollection (
82
- traitsFrom: base + [
83
- UITraitCollection ( horizontalSizeClass: . compact) ,
84
- UITraitCollection ( verticalSizeClass: . regular)
85
- ]
86
- )
87
- }
66
+ let base : [ UITraitCollection ] = [
67
+ UITraitCollection ( forceTouchCapability: . available) ,
68
+ UITraitCollection ( layoutDirection: . leftToRight) ,
69
+ UITraitCollection ( preferredContentSizeCategory: . medium) ,
70
+ UITraitCollection ( userInterfaceIdiom: . phone)
71
+ ]
72
+ switch orientation {
73
+ case . landscape:
74
+ return UITraitCollection (
75
+ traitsFrom: base + [
76
+ UITraitCollection ( horizontalSizeClass: . regular) ,
77
+ UITraitCollection ( verticalSizeClass: . compact)
78
+ ]
79
+ )
80
+ case . portrait:
81
+ return UITraitCollection (
82
+ traitsFrom: base + [
83
+ UITraitCollection ( horizontalSizeClass: . compact) ,
84
+ UITraitCollection ( verticalSizeClass: . regular)
85
+ ]
86
+ )
87
+ }
88
88
}
89
89
90
90
internal static func iPhone14ProMax( _ orientation: ViewImageConfig . Orientation ) -> UITraitCollection {
91
- let base : [ UITraitCollection ] = [
92
- UITraitCollection ( forceTouchCapability: . available) ,
93
- UITraitCollection ( layoutDirection: . leftToRight) ,
94
- UITraitCollection ( preferredContentSizeCategory: . medium) ,
95
- UITraitCollection ( userInterfaceIdiom: . phone)
96
- ]
97
- switch orientation {
98
- case . landscape:
99
- return UITraitCollection (
100
- traitsFrom: base + [
101
- UITraitCollection ( horizontalSizeClass: . regular) ,
102
- UITraitCollection ( verticalSizeClass: . compact)
103
- ]
104
- )
105
- case . portrait:
106
- return UITraitCollection (
107
- traitsFrom: base + [
108
- UITraitCollection ( horizontalSizeClass: . compact) ,
109
- UITraitCollection ( verticalSizeClass: . regular)
110
- ]
111
- )
112
- }
91
+ let base : [ UITraitCollection ] = [
92
+ UITraitCollection ( forceTouchCapability: . available) ,
93
+ UITraitCollection ( layoutDirection: . leftToRight) ,
94
+ UITraitCollection ( preferredContentSizeCategory: . medium) ,
95
+ UITraitCollection ( userInterfaceIdiom: . phone)
96
+ ]
97
+ switch orientation {
98
+ case . landscape:
99
+ return UITraitCollection (
100
+ traitsFrom: base + [
101
+ UITraitCollection ( horizontalSizeClass: . regular) ,
102
+ UITraitCollection ( verticalSizeClass: . compact)
103
+ ]
104
+ )
105
+ case . portrait:
106
+ return UITraitCollection (
107
+ traitsFrom: base + [
108
+ UITraitCollection ( horizontalSizeClass: . compact) ,
109
+ UITraitCollection ( verticalSizeClass: . regular)
110
+ ]
111
+ )
112
+ }
113
113
}
114
114
}
0 commit comments