Skip to content

Commit

Permalink
if we set resetTimerAfterFinish to true, we should call it before cal…
Browse files Browse the repository at this point in the history
…ling delegate

because reset will update the label, and if the user change the label in the delegate, it will be override by the reset, which seems not good
  • Loading branch information
liuxuan30 committed Nov 5, 2015
1 parent 1b55f9e commit dc3d0fc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions MZTimerLabel/MZTimerLabel.m
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,11 @@ -(void)updateLabel{

//0.5.1 moved below to the bottom
if(timerEnded) {
// call reset before we call delegate
if(_resetTimerAfterFinish){
[self reset];
}

if([_delegate respondsToSelector:@selector(timerLabel:finshedCountDownTimerWithTime:)]){
[_delegate timerLabel:self finshedCountDownTimerWithTime:timeUserValue];
}
Expand All @@ -401,9 +406,6 @@ -(void)updateLabel{
_endedBlock(timeUserValue);
}
#endif
if(_resetTimerAfterFinish){
[self reset];
}

}

Expand Down

0 comments on commit dc3d0fc

Please sign in to comment.