[XCode 8, Swift 3] I am using a UIProgressView by setting the observedProgress property to an instance of a Progress object, i.e.:
progressView.observedProgress = myProgress
myProgress.totalUnitCount is initially 0 and the UIProgressView correctly displays 0%. The UIProgressView also tracks the myProgress value beautifully as it changes. However, after the task in question is complete, I'd like to reset the UIProgressView to 0%. I'd expect this to do the job:
myProgress.totalUnitCount = 0
myProgress.completedUnitCount = 0
This doesn't work however, the progress bar continues to show 100%. Even though myProgress.fractionCompleted returns 0.0! I can force the progress bar to return to 0% by doing this:
progressView.progress = 0.0
However, this requires direct access to the view and somewhat defeats the beauty of observing the Progress object.
I haven't been able to find any reset concept on a Progress object. What am I missing?