Merge pull request #113 from pawlowskialex/master

Dispatch LOTAnimationView completion to the main thread on macOS (fixes #103)
This commit is contained in:
Brandon Withrow
2017-02-22 11:41:06 -08:00
committed by GitHub

View File

@@ -557,6 +557,17 @@ const NSTimeInterval singleFrameTimeValue = 1.0 / 60.0;
}
#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;