'How to change ProgressView accentColor in SwiftUI?

This doesn't apply

ProgressView("\(spinnerLabel)")
    .accentColor(.white)

This changes the label

.foregroundColor(.white)

enter image description here



Solution 1:[1]

The selected answer contains a deprecated method, init(tint:).

This is the new way to change the tint color:

ProgressView()
    .tint(.white)

Solution 2:[2]

SwiftUI 3

.tint(Color) changes the current progress color while .background() changes the background of the progress view.

ProgressView(value: summary.ratio)
                    .tint(.white)
                    .background(.black)

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dylan Hand
Solution 2 Swee Kwang