3.4.0
New features
-
Added a new animation rendering engine powered by Core Animation (lean more)
-
When using the new rendering engine, Lottie animations now always smoothly regardless of the amount of work being done on the app’s main thread. This significantly improves animation performance while also eliminating CPU overhead.
-
The Core Animation rendering engine is currently opt-in, configured by a feature flag (
LottieConfiguration.renderingEngine
). In a future major version of Lottie, we plan on enabling the new rendering engine by default. -
Due to limitations of Core Animation, not all Lottie animation features are supported by the new rendering engine. Lottie includes a
RenderingEngineOption.automatic
option, which detects if an animation can be played correctly using the new rendering engine and otherwise falls back to the legacy main thread rendering engine:// Can be enabled globally: // - Use the Core Animation rendering engine if possible, // otherwise fall back to using the Main Thread rendering engine LottieConfiguration.shared.renderingEngine = .automatic // Or when initializing your Animation View: let animationView = AnimationView( animation: ..., configuration: LottieConfiguration(renderingEngine: .automatic))
-
If you encounter any compatibility issues when using RenderingEngineOption.automatic, please file an issue with a copy of your animation json.
-
-
Added new dictionary-based Animation decoding implementation (#1561)
-
2x faster than the existing
Codable
decoding implementation -
There may be some compatibility issues with this implementation, so it is currently opt-in, configured by a feature flag (
LottieConfiguration.decodingStrategy
):// Can be enabled globally: LottieConfiguration.shared.decodingStrategy = .dictionaryBased // Or when initializing your Animation View: let animationView = AnimationView( animation: ..., configuration: LottieConfiguration(decodingStrategy: .dictionaryBased))
-
If you encounter any compatibility issues with this new decoding implementation, please file an issue with a copy of your animation json.
-
-
Added
LottieLogger
type that allows for customizing how Lottie outputs log messages (#1474) -
Add keyframe animation support to
ValueProviders
API (#1491) -
Added support for loading images stored in Asset Catalogs (#1511)
-
Added support for accessing the original value of an AnimationKeypath (#1559)
-
Added support for loading animations with “.json” file extension in name (#1561)
Bug fixes
- Improved performance of Gradient Fill layers (#1558)
- Fixed Carthage support (#1496)
- Avoid automatic animations for rapid opacity changes (#1397)
- Fixed GroupNode empty transform issue (#1372)
- Fixed nil host warning when data url is base64 encoded (#1524)
- Fixed issue where frame parameter was ignored in
AnimationView.init(frame:)
initializer (#1527) - Fixed issue with Polygon rendering (#1537)
- Fixed issue where
layer(for: keypath)
could unexpectedly return nil (#1587) - Improved performance of
BundleImageProvider
by caching images (#1590) - Improved performance of
InvertedMatteLayer
(#1388)