It's taken me days to track down where this issue is coming from.
I have a TableView with rows of custom Table Cells, inside each of which is a progress view. The app calls for the progress view tint to be green/amber/red based on how full it is.
I have discovered that setting the progressTint programmatically causes the progress bar to appear fuller than it should do.
Relevant code (tableView cellForRowAt):
let Max:Double = MyGroup!.EndTimeSeconds - MyGroup!.StartTimeSeconds //10771
let Progress:Double = Date().timeIntervalSince1970 - MyGroup!.StartTimeSeconds //1599.7007069587708
if (Max >= Progress) {
Cell.DescriptionLabel.textColor = UIColor.black
Cell.SubtitleLabel.textColor = UIColor.black
Cell.TargetDeliveryTimeLabel.textColor = UIColor.pts_darkergrey
Cell.ProgressView.setProgress(Float(Progress / Max), animated: false)
Cell.ProgressView.progress = Float(Progress / Max)
Cell.ProgressView.progressTintColor = UIColor.pts_green //if i comment these out it works.
if (Max * 0.75 <= Progress) {
Cell.ProgressView.progressTintColor = UIColor.pts_pbamber //if i comment these out it works.
}
} else {
Cell.DescriptionLabel.textColor = UIColor.white
Cell.SubtitleLabel.textColor = UIColor.white
Cell.TargetDeliveryTimeLabel.textColor = UIColor.white
Cell.ProgressView.setProgress(1, animated: false)
Cell.ProgressView.progress = 1
Cell.ProgressView.progressTintColor = UIColor.pts_pbred //if i comment these out it works.
}
Cell.ProgressView.layer.cornerRadius = 4
Cell.ProgressView.clipsToBounds = true
Screenshot with progressTint calls commented out:

Screenshot with progressTint calls in effect:

Notice the second item's progress bar erroneously gets filled to almost 50% when the tint is set.
The progress bar should fill linearly over time - but this will stay stationary until the progress legitimately passes this point and then it continues like normal.
I may be seeing things but the problem seems to affect the top two items constantly, and not the rest (either as much, or not at all)
I have tried both ProgressView.progress and ProgressView.setProgress, and ProgressView.progressTintColor and PogressView.tintColor.
After some searching and testing... it would appear that the standard
UIProgressViewdoes not like some combination(s) of height, tint color and/or layer modified.Try replacing your
UIProgressViewwith thisSimpleProgressViewIt has defaults of:
You should be able to use this as a direct replacement - no need to make any other changes to your existing code. It's
@IBDesignablewithcornerRadiusandprogressas@IBInspectableso you can set those and see the result in Storyboard.Here's a quick test implementation, comparing
UIProgressViewon top andSimpleProgressViewbelow. Progress bar will start at 10%, increment by 10% with each tap on the view, and change colors at 25, 75 and 100%:I tried to match your custom colors: