Last active
July 17, 2020 01:37
-
-
Save rr-codes/4e5e722a81a3ea86afd3cfdc420da74d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| /// An implementation of `ProgressView` built in SwiftUI | |
| struct ProgressViewSUI<Progress>: View where Progress: BinaryFloatingPoint { | |
| var value: Progress | |
| var body: some View { | |
| GeometryReader { geometry in | |
| ZStack(alignment: .leading) { | |
| Capsule() | |
| .foregroundColor(.gray) | |
| .opacity(0.3) | |
| Capsule() | |
| .foregroundColor(.white) | |
| .frame(width: geometry.size.width * CGFloat(value)) | |
| } | |
| } | |
| .frame(height: 4) | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment