File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ class OTPProgressRing: UIView {
53
53
private func configureSublayers( ) {
54
54
layer. addSublayer ( backgroundRingLayer)
55
55
layer. addSublayer ( foregroundRingLayer)
56
- updateRingColor ( tintColor)
56
+ updateWithRingColor ( tintColor)
57
57
}
58
58
59
59
// MARK: Layout
@@ -71,7 +71,12 @@ class OTPProgressRing: UIView {
71
71
72
72
override func tintColorDidChange( ) {
73
73
super. tintColorDidChange ( )
74
- updateRingColor ( tintColor)
74
+ updateWithRingColor ( tintColor)
75
+ }
76
+
77
+ private func updateWithRingColor( _ ringColor: UIColor ) {
78
+ foregroundRingLayer. strokeColor = ringColor. cgColor
79
+ backgroundRingLayer. strokeColor = ringColor. withAlphaComponent ( 0.2 ) . cgColor
75
80
}
76
81
77
82
func updateWithViewModel( _ viewModel: ProgressRingViewModel ) {
@@ -84,11 +89,6 @@ class OTPProgressRing: UIView {
84
89
animation. toValue = 1
85
90
foregroundRingLayer. add ( animation, forKey: path)
86
91
}
87
-
88
- private func updateRingColor( _ tintColor: UIColor ) {
89
- foregroundRingLayer. strokeColor = tintColor. cgColor
90
- backgroundRingLayer. strokeColor = tintColor. withAlphaComponent ( 0.2 ) . cgColor
91
- }
92
92
}
93
93
94
94
private class RingLayer : CAShapeLayer {
You can’t perform that action at this time.
0 commit comments