Reset the offset so that when we come back from being suspended the animation restarts

This commit is contained in:
Maurice Parker
2022-11-13 12:29:37 -06:00
parent 17f5240857
commit 10288f7969

View File

@@ -53,11 +53,14 @@ struct RefreshProgressView: View {
.offset(x: -Self.width * 0.6, y: 0)
.offset(x: Self.width * 1.2 * self.offset, y: 0)
.animation(.default.repeatForever().speed(0.265), value: self.offset)
.onAppear{
.onAppear {
withAnimation {
self.offset = 1
}
}
.onDisappear {
self.offset = 0
}
)
.clipShape(Capsule())
.frame(width: Self.width, height: Self.height)