Structure¶
LinearProgressViewStyle¶
A progress view that visually indicates its progress using a horizontal bar.¶
Declaration¶
struct LinearProgressViewStyle : ProgressViewStyle
Overview¶
When initializing a ProgressView with init(value:total:), the DefaultProgressViewStyle will typically display a linear progress view style:
struct ContentView: View {
var body: some View {
ProgressView(value: 0.5)
}
}

A ProgressView initialized with init(), on the other hand, defaults to a "spinner" style:
struct ContentView: View {
var body: some View {
ProgressView()
}
}

To turn it into a linear progress view, apply this style with the progressViewStyle(_:) modifier:
struct ContentView: View {
var body: some View {
ProgressView()
.progressViewStyle(LinearProgressViewStyle())
}
}

Availability¶
iOS 14.0+
macOS 11.0+
tvOS 14.0+
watchOS 7.0+
Topics¶
Initializer¶
init() Creates a linear progress view style.
init(tint:) Creates a linear progress view style with a tint color.
Type Alias¶
Body A view representing the body of a progress view.
Instance Method¶
makeBody(configuration:) Creates a view representing the body of a progress view.