@@ -12,20 +12,29 @@ extension UIImage {
12
12
enum Buttons {
13
13
// Button images we expect as tightly cropped 24x24 images. The SVGs are 20x20 with a 2px border
14
14
static var account : UIImage {
15
- UIImage ( named: " IconAccount " ) !. rescaled ( by: 24 / 20 )
15
+ UIImage ( named: " IconAccount " ) !
16
+ . resized ( to: CGSize ( width: 24 , height: 24 ) , trimmingBorder: 2 )
16
17
}
17
18
18
19
static var alert : UIImage {
19
- UIImage ( named: " IconAlert " ) !. rescaled ( by: 24 / 20 )
20
+ UIImage ( named: " IconAlert " ) !
21
+ . resized ( to: CGSize ( width: 24 , height: 24 ) , trimmingBorder: 2 )
20
22
}
21
23
22
24
static var info : UIImage {
23
25
// the info icon was 18x18 cropped
24
- UIImage ( named: " IconInfo " ) !. resizeImage ( targetSize: CGSize ( width: 21.5 , height: 21.5 ) )
26
+ UIImage ( named: " IconInfo " ) !
27
+ . resized ( to: CGSize ( width: 18 , height: 18 ) , trimmingBorder: 2 )
28
+ }
29
+
30
+ static var infoLarge : UIImage {
31
+ UIImage ( named: " IconInfo " ) !
32
+ . resized ( to: CGSize ( width: 44 , height: 44 ) , trimmingBorder: 2 )
25
33
}
26
34
27
35
static var settings : UIImage {
28
- UIImage ( named: " IconSettings " ) !. rescaled ( by: 24 / 20 )
36
+ UIImage ( named: " IconSettings " ) !
37
+ . resized ( to: CGSize ( width: 24 , height: 24 ) , trimmingBorder: 2 )
29
38
}
30
39
31
40
static var back : UIImage {
@@ -52,14 +61,15 @@ extension UIImage {
52
61
UIImage ( named: " IconUnobscure " ) !
53
62
}
54
63
55
- // the close button, which comes we consume in two sizes, both of which come from the same asset
64
+ // the close button, which comes we consume in two sizes, both of which come from the same asset. The SVG is 48x48, though with 4 pixels of border
56
65
57
66
static var closeSmall : UIImage {
58
- UIImage ( named: " IconClose " ) !. resizeImage ( targetSize: CGSize ( width: 19 , height: 19 ) )
67
+ UIImage ( named: " IconClose " ) !
68
+ . resized ( to: CGSize ( width: 16 , height: 16 ) , trimmingBorder: 2 )
59
69
}
60
70
61
71
static var closeLarge : UIImage {
62
- UIImage ( named: " IconClose " ) !. resizeImage ( targetSize : CGSize ( width: 29 , height: 29 ) )
72
+ UIImage ( named: " IconClose " ) !. resized ( to : CGSize ( width: 24 , height: 24 ) , trimmingBorder : 2 )
63
73
}
64
74
}
65
75
@@ -82,7 +92,7 @@ extension UIImage {
82
92
83
93
static var tick : UIImage {
84
94
UIImage ( named: " IconTickSml " ) !
85
- . resizeImage ( targetSize : CGSize ( width: 16 , height: 16 ) )
95
+ . resized ( to : CGSize ( width: 16 , height: 16 ) )
86
96
}
87
97
}
88
98
@@ -102,15 +112,6 @@ extension UIImage {
102
112
103
113
static var tick : UIImage {
104
114
UIImage ( named: " IconTickSml " ) !
105
- . resizeImage ( targetSize: CGSize ( width: 24 , height: 24 ) )
106
- }
107
-
108
- // a utility function to resize an image by an aspect ratio;
109
- // used for compensating for scalable assets' nominal sizes being off
110
- func rescaled( by ratio: CGFloat ) -> UIImage {
111
- resizeImage ( targetSize: CGSize (
112
- width: size. width * ratio,
113
- height: size. height * ratio
114
- ) )
115
+ . resized ( to: CGSize ( width: 24 , height: 24 ) )
115
116
}
116
117
}
0 commit comments