Skip to content

Instantly share code, notes, and snippets.

@sturdysturge
Last active January 4, 2021 11:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sturdysturge/586633b3b78e54118d448a8ac61da236 to your computer and use it in GitHub Desktop.
Save sturdysturge/586633b3b78e54118d448a8ac61da236 to your computer and use it in GitHub Desktop.
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