Skip to content

Commit

Permalink
Put CATransaction completion listener inside the begin/end block.
Browse files Browse the repository at this point in the history
  • Loading branch information
7jason committed Mar 25, 2020
1 parent 934954c commit 902b836
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lottie-swift/src/Public/Animation/AnimationView.swift
Expand Up @@ -809,12 +809,12 @@ final public class AnimationView: LottieView {
/// Updates the animation frame. Does not affect any current animations
func updateAnimationFrame(_ newFrame: CGFloat) {
CATransaction.begin()
CATransaction.setDisableActions(true)
animationLayer?.currentFrame = newFrame
CATransaction.commit()
CATransaction.setCompletionBlock {
self.animationLayer?.forceDisplayUpdate()
}
CATransaction.setDisableActions(true)
animationLayer?.currentFrame = newFrame
CATransaction.commit()
}

@objc override func animationWillMoveToBackground() {
Expand Down

0 comments on commit 902b836

Please sign in to comment.