Skip to content

Instantly share code, notes, and snippets.

@mattThousand
Created November 25, 2019 03:04
Show Gist options
  • Save mattThousand/8755f61931bdd069ccb3222e11dedbf2 to your computer and use it in GitHub Desktop.
Save mattThousand/8755f61931bdd069ccb3222e11dedbf2 to your computer and use it in GitHub Desktop.
struct AnimatedView: View {
@State var percentComplete: CGFloat = 0.0
var body: some View {
Ellipse()
.trim(from: 0, to: self.percentComplete)
.stroke(Color.purple, style: StrokeStyle(lineWidth: 20, lineCap: .round))
.frame(width: UIScreen.main.bounds.width / 2, height: UIScreen.main.bounds.width)
.animation(.easeOut(duration: 2.0))
.onAppear {
self.percentComplete = 0.7
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment