Skip to content

Commit

Permalink
Merge pull request #57 from GuoZhiQiang/patch-1
Browse files Browse the repository at this point in the history
Update UICountingLabel.m: fix crash
  • Loading branch information
dataxpress authored Feb 6, 2018
2 parents 4193611 + 0ab17df commit ff47ad0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions UICountingLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ -(void)countFrom:(CGFloat)startValue to:(CGFloat)endValue withDuration:(NSTimeIn
[self.timer invalidate];
self.timer = nil;

if(self.format == nil) {
self.format = @"%f";
}
if (duration == 0.0) {
// No animation
[self setTextValue:endValue];
Expand All @@ -121,9 +124,6 @@ -(void)countFrom:(CGFloat)startValue to:(CGFloat)endValue withDuration:(NSTimeIn
self.totalTime = duration;
self.lastUpdate = [NSDate timeIntervalSinceReferenceDate];

if(self.format == nil)
self.format = @"%f";

switch(self.method)
{
case UILabelCountingMethodLinear:
Expand Down

0 comments on commit ff47ad0

Please sign in to comment.