Created
November 25, 2019 03:04
-
-
Save mattThousand/8755f61931bdd069ccb3222e11dedbf2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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