Skip to content

Commit bb35c7f

Browse files
add progress animation
1 parent c380310 commit bb35c7f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Sources/ComponentsKit/Components/CircularProgress/Models/CircularProgressVM.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ public struct CircularProgressVM: ComponentVM {
4343
// MARK: Shared Helpers
4444

4545
extension CircularProgressVM {
46+
var animationDuration: TimeInterval {
47+
return 0.2
48+
}
4649
var circularLineWidth: CGFloat {
4750
return self.lineWidth ?? max(self.preferredSize.width / 8, 2)
4851
}

Sources/ComponentsKit/Components/CircularProgress/SUCircularProgress.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ public struct SUCircularProgress: View {
7777
.foregroundColor(self.model.color.main.color)
7878
}
7979
}
80+
.animation(
81+
Animation.linear(duration: self.model.animationDuration),
82+
value: self.progress
83+
)
8084
}
8185

8286
// MARK: - Subviews

0 commit comments

Comments
 (0)