4.0.0
Learn more about this release: Announcing Lottie 4.0 for iOS on the Airbnb Tech Blog
Major changes
-
The new Core Animation rendering engine (first introduced in Lottie 3.4.0) is now enabled by default for supported animations.
- Specifically,
LottieConfiguration.shared.renderingEngine
now defaults to.automatic
instead of.mainThread
. Animations that use features which are not supported by the Core Animation rendering engine will automatically fall back to using the original Main Thread rendering engine. - When using the Core Animation rendering engine, Lottie animations now always animate 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.
- If you encounter any compatibility issues when using
RenderingEngineOption.automatic
, please file an issue with a copy of your animation json.
- Specifically,
-
DecodingStrategy.dictionaryBased
is now enabled by default- The new dictionary-based decoding implementation is 2x faster than the previous
Codable
decoding implementation - If you encounter any compatibility issues with this new decoding implementation, please file an issue with a copy of your animation json.
- The new dictionary-based decoding implementation is 2x faster than the previous
-
Backwards compatibility typealiases for
Animation
,AnimationView
,Color
,Vector1D
,Vector2D
, andVector3D
, which were introduced in Lottie 3.5.0, have been removed to resolve conflicts with types in Apple frameworks. These types are now namedLottieAnimation
,LottieAnimationView
,LottieColor
,LottieVector1D
,LottieVector2D
, andLottieVector3D
. -
The default
LottieBackgroundBehavior
used byLottieAnimationView
is now.pauseAndRestore
instead ofpause
. -
Lottie for iOS now supports the dotLottie file format.
-
The library's minimum-supported Swift version is now Swift 5.5.
Full changelog
- Use
RenderingEngineOption.automatic
by default by @calda in #1764 - Fix issue where inverted mask layer was clipped incorrectly by @calda in #1763
- Bump to 4.0.0, remove backwards compatibility typealiases by @calda in #1768
- Update
LottieBackgroundBehavior.default
from.pause
to.pauseAndRestore
for Main Thread rendering engine by @calda in #1770 - Adds ability to not play the frame of the end marker (#1758) by @lennartstolz in #1772
- Change LottieAnimationHelpers default animation cache to LRUAnimationCache.shared (#1773) by @pejato in #1778
- Update LottieConfiguration to use DecodingStrategy.dictionaryBased by default by @marcelofabri in #1777
- Allow customizing default AnimationCacheProvider by @marcelofabri in #1779
- Replace LRUAnimationCache with a thread-safe NSCache-based cache by @marcelofabri in #1783
- Update minimum Swift version to 5.5 by @calda in #1787
- Adds .lottie file load capability to LottieAnimation by @eharrison in #1785
- Add Rounded Corners by @johnny-duo in #1795
- Add rounded corner support to Core Animation rendering engine by @calda in #1796
- Add support for animating
startPoint
andendPoint
of radial gradients by @calda in #1798 - Update Core Animation rendering engine to use device RGB color space by @calda in #1801
- added mask to bounds flag by @BugorBN in #1814
- Add completion callbacks to LottieAnimationView DotLottie initializers by @calda in #1810