mirror of
https://github.com/pointfreeco/swift-composable-architecture.git
synced 2025-12-20 09:11:33 +01:00
* Update examples - Use `#Preview` macro - Remove superfluous `// MARK` comments * Simplify case studies Prefer simple `StoreOf` declaration in case study views * update some outdated descriptions * wip * wip
22 lines
447 B
Swift
22 lines
447 B
Swift
import SwiftUI
|
|
|
|
struct CircularProgressView: View {
|
|
private let value: Double
|
|
|
|
init(value: Double) {
|
|
self.value = value
|
|
}
|
|
|
|
var body: some View {
|
|
Circle()
|
|
.trim(from: 0, to: CGFloat(self.value))
|
|
.stroke(style: StrokeStyle(lineWidth: 2, lineCap: .round))
|
|
.rotationEffect(.degrees(-90))
|
|
.animation(.easeIn, value: self.value)
|
|
}
|
|
}
|
|
|
|
#Preview {
|
|
CircularProgressView(value: 0.3).frame(width: 44, height: 44)
|
|
}
|