In iOS15 UIProgressView changed behavior. When I use self.progress.setProgress(1.0, animated: true), it starts from transparent style. How to return to "alpha = 1" style.
P.S.: progress.alpha = 1 does not work
In iOS15 UIProgressView changed behavior. When I use self.progress.setProgress(1.0, animated: true), it starts from transparent style. How to return to "alpha = 1" style.
P.S.: progress.alpha = 1 does not work
The only way to change this opaque/transparent behavior is to use your own Timer.
private let progressUnit = Progress(totalUnitCount: 20)
func startAnimate(){
self.progressView.setProgress(0.0, animated: false)
self.progressUnit.completedUnitCount = 0
Timer.scheduledTimer(withTimeInterval: 0.5, repeats: true) { timer in
guard self.progressUnit.isFinished == false else{
timer.invalidate()
return
}
self.progressUnit.completedUnitCount += 1
let progressFloat = Float(self.progressUnit.fractionCompleted)
self.progressView.setProgress(progressFloat, animated: true)
}
}