Skip to content

Commit 61f1379

Browse files
committed
Refactor ring view initialization
1 parent 9266990 commit 61f1379

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

Authenticator/Source/OTPProgressRing.swift

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,19 @@ class OTPProgressRing: UIView {
3838
private let backgroundRingLayer = RingLayer()
3939
private let foregroundRingLayer = RingLayer()
4040

41+
// MARK: Initialize
42+
43+
override init(frame: CGRect) {
44+
super.init(frame: frame)
45+
configureSublayers()
46+
}
47+
4148
required init?(coder aDecoder: NSCoder) {
4249
super.init(coder: aDecoder)
50+
configureSublayers()
4351
}
4452

45-
override init(frame: CGRect) {
46-
super.init(frame: frame)
53+
private func configureSublayers() {
4754
layer.addSublayer(backgroundRingLayer)
4855
layer.addSublayer(foregroundRingLayer)
4956
updateRingColor(tintColor)

0 commit comments

Comments
 (0)