From 45517c3cfec9469bbdd4f86e32393c28ae9df0bc Mon Sep 17 00:00:00 2001 From: Cal Stephens Date: Fri, 29 Sep 2023 14:31:45 -0700 Subject: [PATCH] Fix unexpected crossfade animation when updating Lottie animation or rendering engine (#2202) --- README.md | 2 +- Sources/Public/Animation/LottieAnimationLayer.swift | 4 ++++ lottie-ios.podspec | 2 +- package.json | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0235145ae3..c61e9937dd 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ To install Lottie using [Swift Package Manager](https://github.com/apple/swift-p or you can add the following dependency to your `Package.swift`: ```swift -.package(url: "https://github.com/airbnb/lottie-spm.git", from: "4.3.2") +.package(url: "https://github.com/airbnb/lottie-spm.git", from: "4.3.3") ``` When using Swift Package Manager we recommend using the [lottie-spm](https://github.com/airbnb/lottie-spm) repo instead of the main lottie-ios repo. The main git repository for [lottie-ios](https://github.com/airbnb/lottie-ios) is somewhat large (300+ MB), and Swift Package Manager always downloads the full repository with all git history. The [lottie-spm](https://github.com/airbnb/lottie-spm) repo is much smaller (less than 500kb), so can be downloaded much more quickly. diff --git a/Sources/Public/Animation/LottieAnimationLayer.swift b/Sources/Public/Animation/LottieAnimationLayer.swift index 0eab746fa2..9ee90ff384 100644 --- a/Sources/Public/Animation/LottieAnimationLayer.swift +++ b/Sources/Public/Animation/LottieAnimationLayer.swift @@ -1134,6 +1134,10 @@ public class LottieAnimationLayer: CALayer { } fileprivate func makeAnimationLayer(usingEngine renderingEngine: RenderingEngineOption) { + /// Disable the default implicit crossfade animation Core Animation creates + /// when adding or removing sublayers. + actions = ["sublayers": NSNull()] + /// Remove current animation if any removeCurrentAnimation() diff --git a/lottie-ios.podspec b/lottie-ios.podspec index c2c905ac99..aedf9c145f 100644 --- a/lottie-ios.podspec +++ b/lottie-ios.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'lottie-ios' - s.version = '4.3.2' + s.version = '4.3.3' s.summary = 'A library to render native animations from bodymovin json' s.description = <<-DESC diff --git a/package.json b/package.json index 5c1c00031e..3955255eec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "lottie-ios", - "version": "4.3.2", + "version": "4.3.3", "description": "Lottie is a mobile library for Android and iOS that parses Adobe After Effects animations exported as json with bodymovin and renders the vector animations natively on mobile and through React Native!", "main": "index.js", "scripts": {