How To Create Progress View In SwiftUI

The second version of SwiftUI and iOS14 introduced Progress View.

The basic usage it’s just ProgressView without any parameter.

ProgressView()

You can put there some label on it.

ProgressView(“Downloading data…”)

Or change it to linear progress.

ProgressView(value: 0.4)

The max value is 1.

Another way is to use all of the options above and put some value, set the maximum value, and add some text.

ProgressView(value: 10, total: 100, label: {
    
Text(“Loading”)
    
Image(systemName: “star”)
})