Skip to content

Commit

Permalink
fixed completion block timing, so nested calls work properly, fixes #30
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Emrich committed Nov 16, 2013
1 parent a8ca420 commit 4c661ea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions JDFlipNumberView/JDFlipNumberView.m
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,10 @@ - (void)handleTimer:(NSTimer*)timer
(self.animationType == JDFlipAnimationTypeTopDown && newValue > self.targetValue) ||
(self.animationType == JDFlipAnimationTypeBottomUp && newValue < self.targetValue)) {
[self setValue:self.targetValue animatedInCurrentDirection:YES];
JDFlipAnimationCompletionBlock completion = self.completionBlock;
self.completionBlock = nil;
[self stopAnimation];
if (self.completionBlock != nil) {
JDFlipAnimationCompletionBlock completion = self.completionBlock;
self.completionBlock = nil;
if (completion) {
completion(YES);
}
return;
Expand Down

0 comments on commit 4c661ea

Please sign in to comment.