From d790f37c2f3bf2c8c8a45ab7df011f20ef844f01 Mon Sep 17 00:00:00 2001 From: Tom Solchan Ahn Date: Tue, 17 Sep 2024 02:41:24 +0900 Subject: [PATCH] =?UTF-8?q?[Feature]=20animation=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Sources/Components/Progress/BezierProgressBar.swift | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/BezierSwift/Sources/Components/Progress/BezierProgressBar.swift b/BezierSwift/Sources/Components/Progress/BezierProgressBar.swift index f18f944e..88e7594a 100644 --- a/BezierSwift/Sources/Components/Progress/BezierProgressBar.swift +++ b/BezierSwift/Sources/Components/Progress/BezierProgressBar.swift @@ -59,9 +59,10 @@ public struct BezierProgressBar: View { .frame(height: self.height) .frame(minWidth: self.minWidth) .frame( - width: (proxy.size.width + self.minWidth) * min(self.progress, Constant.maxProgress), + width: (proxy.size.width) * min(self.progress, Constant.maxProgress), alignment: .leading ) + .animation(self.animation, value: self.progress) } } } @@ -95,6 +96,10 @@ extension BezierProgressBar { private var minWidth: CGFloat { self.progress.isZero ? 0 : self.height } + + private var animation: Animation { + Animation.timingCurve(0.24, 0.1, 0.24, 1.0, duration: 1.0) + } } #Preview {