Modern Concurrency: Getting Started

Oct 18 2022 Swift 5.5, iOS 15, Xcode 13.4

Part 2: Asynchronous Sequences

12. Displaying a Progress View

Episode complete

Play next episode

Next
Save for later
About this episode
See forum comments
Cinema mode Mark complete Download course materials
Previous episode: 11. Using Asynchronous Methods in Views Next episode: 13. Downloading Chunks

This video Displaying a Progress View was last updated on Oct 18 2022

Heads up... You've reached locked video content where the transcript will be shown as obfuscated text.

You can unlock the rest of this video course, and our entire catalogue of books and videos, with a kodeco.com Professional subscription.

DownloadView has a Boolean State property isDownloadActive. It passes a binding to this property to FileDetails, where its value controls the display of a ProgressView — a spinning activity indicator — next to the filename.

Start spinner

In the downloadSingleAction definition, I added this code before Task:

isDownloadActive = true
do {
  fileData = try await model.download(file: file)
} catch { }
isDownloadActive = false