Skip to content

Commit

Permalink
Merge pull request #113 from pawlowskialex/master
Browse files Browse the repository at this point in the history
Dispatch LOTAnimationView completion to the main thread on macOS (fixes #103)
  • Loading branch information
buba447 committed Feb 22, 2017
2 parents 1ebc1b9 + acbdfb7 commit d91fc78
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lottie-ios/Classes/Private/LOTAnimationView.m
Expand Up @@ -557,6 +557,17 @@ - (void)layoutSubviews {
}

#else

- (void)setCompletionBlock:(LOTAnimationCompletionBlock)completionBlock {
if (completionBlock) {
_completionBlock = ^(BOOL finished) {
dispatch_async(dispatch_get_main_queue(), ^{ completionBlock(finished); });
};
}
else {
_completionBlock = nil;
}
}

- (void)setContentMode:(LOTViewContentMode)contentMode {
_contentMode = contentMode;
Expand Down

0 comments on commit d91fc78

Please sign in to comment.