Skip to content

Commit

Permalink
Merge pull request #1056 from airbnb/btw/threadCheck
Browse files Browse the repository at this point in the history
Add a main thread check
  • Loading branch information
buba447 committed Oct 10, 2019
2 parents 18f37e1 + e799852 commit a5d2fd8
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ class AnimationContainer: CALayer {
}

public override func display() {
guard Thread.isMainThread else { return }
var newFrame: CGFloat = self.presentation()?.currentFrame ?? self.currentFrame
if respectAnimationFrameRate {
newFrame = floor(newFrame)
Expand Down

0 comments on commit a5d2fd8

Please sign in to comment.