Steps: Run attached project in 2019R1.1 or older version (such as 2014R2.1)
Expected behavior: progress bar update should be smooth (the timer is updating at 60Hz)
Actual behavior: under 2019R1.1, the update is jerky (it looks like it’s updating every 10 frames, rather than every frame)
It works fine in 2014R2.1, but is broken in 2019R1.1 - anyone know when it broke?
Interesting - if you set the timer to 1000msec, the progress bar only updates every 10 seconds. So it’s not that updates are being skipped, rather it’s almost as if inside the ProgressBar.value method, the resolution of .value is being reduced by a factor of 10 like this:
ProgressBar.value(newValue as integer)
newValue = (newValue \\ 10) * 10 // throw away last decimal digit
Edit: I tried changing ProgressBar.maximum from 1000 to 1000000, and then updating value in steps of 1000, but no change, but this doesn’t seem to be a valid workaround.
Searching ReleaseNotes between 2019R1.1 and 2014R2.1 for mentions of ProgressBar, I find only this:
44947 Framework » iOS Default max value for iOSProgressBar is now 100.
which doesn’t seem relevant, but who knows.
It looks to me like the value is only updating the display in increments of 100 when using your maximum of 10000. You may best served by setting your maximum to 100 and calculated the value as a percentage:
(currentValue / totalValue) * 100
Possibly, but with a long progress bar on a retina screen, it looks ugly - each jump may be 40 or more pixels…
I take a different approach to progressbars. I don’t update them via a timer… since you don’t know how much if any progress has been made in the time interval, and you might just be wasting cycles.
What I do is keep track of the progress (separate from pb.value) and when it has progressed X amount beyound pb.value, then I update it… and X will vary depending on how long the progress maximum is…