MRProgress
MRProgress copied to clipboard
Crash when progress value changes is too small
@implementation MRCircularProgressView {
int _valueLabelProgressPercentDifference;
}
As you declared that variable as int, it is crashing here.
// Add timer to update valueLabel
_valueLabelProgressPercentDifference = (progress - self.progress) * 100;
CFTimeInterval timerInterval = self.animationDuration / ABS(_valueLabelProgressPercentDifference);
self.valueLabelUpdateTimer = [NSTimer scheduledTimerWithTimeInterval:timerInterval
target:self
selector:@selector(onValueLabelUpdateTimer:)
userInfo:nil
repeats:YES];
if progress - self.progress
value is smaller than 0.001 then 100% crash because difference becomes zero.
I found it when reporting progress from CloudKit asset download and I did nothing tricky to make it crash.
I am not sure if this is bug or not :), but wanted to let you know.
Thanks.