Skip to content

Commit 677132b

Browse files
committed
updateProgress deleted from init
- stroke values and label text inside the setup method
1 parent 44ed157 commit 677132b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Sources/ComponentsKit/Components/CircularProgress/UKCircularProgress.swift

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ open class UKCircularProgress: UIView, UKComponent {
5959
self.setup()
6060
self.style()
6161
self.layout()
62-
63-
self.updateProgress()
6462
}
6563

6664
public required init?(coder: NSCoder) {
@@ -82,6 +80,19 @@ open class UKCircularProgress: UIView, UKComponent {
8280
view.handleTraitChanges()
8381
}
8482
}
83+
84+
CATransaction.begin()
85+
CATransaction.setDisableActions(true)
86+
87+
let progress = self.model.progress(for: self.currentValue)
88+
self.progressLayer.strokeEnd = progress
89+
if !self.model.isStripesLayerHidden {
90+
self.stripesMaskLayer.strokeStart = self.model.stripedArcStart(for: progress)
91+
self.stripesMaskLayer.strokeEnd = self.model.stripedArcEnd(for: progress)
92+
}
93+
self.label.text = self.model.label
94+
95+
CATransaction.commit()
8596
}
8697

8798
// MARK: - Style

0 commit comments

Comments
 (0)