mirror of
https://github.com/insidegui/VirtualBuddy.git
synced 2026-12-02 05:09:26 +08:00
20 lines
432 B
Swift
20 lines
432 B
Swift
import SwiftUI
|
|
|
|
struct ContinuousProgressIndicator<Content: View>: View {
|
|
var duration: TimeInterval
|
|
@ViewBuilder var content: (Double) -> Content
|
|
|
|
@State private var progress = Double(0)
|
|
|
|
var body: some View {
|
|
ZStack {
|
|
content(progress)
|
|
}
|
|
.task { @MainActor in
|
|
withAnimation(.easeIn(duration: duration)) {
|
|
progress = 1
|
|
}
|
|
}
|
|
}
|
|
}
|