-
-
Save sturdysturge/586633b3b78e54118d448a8ac61da236 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 ContentView: View { | |
@StateObject var dataModel = DataModel() | |
var body: some View { | |
VStack { | |
if let image = dataModel.image { | |
Image(uiImage: image) | |
.resizable() | |
.scaledToFit() | |
} else if dataModel.progress == 1 { | |
ProgressView() | |
.progressViewStyle(CircularProgressViewStyle()) | |
.frame(maxWidth: .infinity, maxHeight: .infinity) | |
} else { | |
Spacer() | |
} | |
ProgressView(dataModel.progressText, value: dataModel.progress) | |
Button("Download file") { | |
dataModel.download() | |
} | |
} | |
.padding() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment