@@ -22,17 +22,17 @@ extension UIButton {
22
22
23
23
let normalBackgroundImage = UIImage . renderBackgroundImage ( fill: . primaryButtonBackground,
24
24
border: . primaryButtonBorder)
25
- . applyTintColorToiOS13 ( . primaryButtonBackground)
25
+ . withTintColor ( . primaryButtonBackground)
26
26
setBackgroundImage ( normalBackgroundImage, for: . normal)
27
27
28
28
let highlightedBackgroundImage = UIImage . renderBackgroundImage ( fill: . primaryButtonDownBackground,
29
29
border: . primaryButtonDownBorder)
30
- . applyTintColorToiOS13 ( . primaryButtonDownBackground)
30
+ . withTintColor ( . primaryButtonDownBackground)
31
31
setBackgroundImage ( highlightedBackgroundImage, for: . highlighted)
32
32
33
33
let disabledBackgroundImage = UIImage . renderBackgroundImage ( fill: . buttonDisabledBackground,
34
34
border: . buttonDisabledBorder)
35
- . applyTintColorToiOS13 ( . buttonDisabledBorder) // Use border as tint color since the background is clear
35
+ . withTintColor ( . buttonDisabledBorder) // Use border as tint color since the background is clear
36
36
setBackgroundImage ( disabledBackgroundImage, for: . disabled)
37
37
}
38
38
@@ -54,17 +54,17 @@ extension UIButton {
54
54
55
55
let normalBackgroundImage = UIImage . renderBackgroundImage ( fill: . secondaryButtonBackground,
56
56
border: . secondaryButtonBorder)
57
- . applyTintColorToiOS13 ( . secondaryButtonBackground)
57
+ . withTintColor ( . secondaryButtonBackground)
58
58
setBackgroundImage ( normalBackgroundImage, for: . normal)
59
59
60
60
let highlightedBackgroundImage = UIImage . renderBackgroundImage ( fill: . secondaryButtonDownBackground,
61
61
border: . secondaryButtonDownBorder)
62
- . applyTintColorToiOS13 ( . secondaryButtonDownBackground)
62
+ . withTintColor ( . secondaryButtonDownBackground)
63
63
setBackgroundImage ( highlightedBackgroundImage, for: . highlighted)
64
64
65
65
let disabledBackgroundImage = UIImage . renderBackgroundImage ( fill: . buttonDisabledBackground,
66
66
border: . buttonDisabledBorder)
67
- . applyTintColorToiOS13 ( . buttonDisabledBackground)
67
+ . withTintColor ( . buttonDisabledBackground)
68
68
setBackgroundImage ( disabledBackgroundImage, for: . disabled)
69
69
}
70
70
@@ -110,25 +110,25 @@ extension UIButton {
110
110
111
111
let normalBackgroundImage = UIImage . renderBackgroundImage ( fill: . tertiarySystemBackground,
112
112
border: . secondaryButtonBorder)
113
- . applyTintColorToiOS13 ( . tertiarySystemBackground)
113
+ . withTintColor ( . tertiarySystemBackground)
114
114
setBackgroundImage ( normalBackgroundImage, for: . normal)
115
115
116
116
let highlightedBackgroundImage = UIImage . renderBackgroundImage ( fill: . secondaryButtonDownBackground,
117
117
border: . secondaryButtonDownBorder)
118
- . applyTintColorToiOS13 ( . secondaryButtonDownBackground)
118
+ . withTintColor ( . secondaryButtonDownBackground)
119
119
setBackgroundImage ( highlightedBackgroundImage, for: . highlighted)
120
120
121
121
let disabledBackgroundImage = UIImage . renderBackgroundImage ( fill: . buttonDisabledBackground,
122
122
border: . buttonDisabledBorder)
123
- . applyTintColorToiOS13 ( . buttonDisabledBackground)
123
+ . withTintColor ( . buttonDisabledBackground)
124
124
setBackgroundImage ( disabledBackgroundImage, for: . disabled)
125
125
}
126
126
127
127
/// Applies the Single-Color Icon Button Style: accent/accent dark tint color
128
128
///
129
129
func applyIconButtonStyle( icon: UIImage ) {
130
- let normalImage = icon. applyTintColor ( . accent)
131
- let highlightedImage = icon. applyTintColor ( . accentDark)
130
+ let normalImage = icon. withTintColor ( . accent)
131
+ let highlightedImage = icon. withTintColor ( . accentDark)
132
132
setImage ( normalImage, for: . normal)
133
133
setImage ( highlightedImage, for: . highlighted)
134
134
tintColor = . accent
0 commit comments