Skip to content

Commit

Permalink
Dispatch LOTAnimationView completion to the main thread on macOS (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
pawlowskialex committed Feb 22, 2017
1 parent 1ebc1b9 commit acbdfb7
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 acbdfb7

Please sign in to comment.