An iOS library to natively render After Effects vector animations

Overview

Lottie for iOS, macOS (and Android and React Native)

VersionLicensePlatform

View documentation, FAQ, help, examples, and more at airbnb.io/lottie

Lottie is a mobile library for Android and iOS that natively renders vector based animations and art in realtime with minimal code.

Lottie loads and renders animations and vectors exported in the bodymovin JSON format. Bodymovin JSON can be created and exported from After Effects with bodymovin, Sketch with Lottie Sketch Export, and from Haiku.

For the first time, designers can create and ship beautiful animations without an engineer painstakingly recreating it by hand. Since the animation is backed by JSON they are extremely small in size but can be large in complexity! Animations can be played, resized, looped, sped up, slowed down, reversed, and even interactively scrubbed. Lottie can play or loop just a portion of the animation as well, the possibilities are endless! Animations can even be changed at runtime in various ways! Change the color, position or any keyframable value! Lottie also supports native UIViewController Transitions out of the box!

Here is just a small sampling of the power of Lottie

Example1 Example2

Example3

Abcs

Installing Lottie

Lottie supports CocoaPods and Carthage (Both dynamic and static). Lottie is written in Swift 4.2.

Github Repo

You can pull the Lottie Github Repo and include the Lottie.xcodeproj to build a dynamic or static library.

CocoaPods

Add the pod to your Podfile:

pod 'lottie-ios'

And then run:

pod install

After installing the cocoapod into your project import Lottie with

import Lottie

Carthage

Add Lottie to your Cartfile:

github "airbnb/lottie-ios" "master"

And then run:

carthage update

In your application targets “General” tab under the “Linked Frameworks and Libraries” section, drag and drop lottie-ios.framework from the Carthage/Build/iOS directory that carthage update produced.

Swift Package Manager

// swift-tools-version:5.1

import PackageDescription

let package = Package(
  name: "YourTestProject",
  platforms: [
       .iOS(.v12),
  ],
  dependencies: [
    .package(url: "https://github.com/airbnb/lottie-ios.git", from: "3.1.2")
  ],
  targets: [
    .target(name: "YourTestProject", dependencies: ["Lottie"])
  ]
)

And then import wherever needed: import Lottie

Adding it to an existent iOS Project via Swift Package Manager

  1. Using Xcode 11 go to File > Swift Packages > Add Package Dependency
  2. Paste the project URL: https://github.com/airbnb/lottie-ios
  3. Click on next and select the project target
  4. Don't forget to set DEAD_CODE_STRIPPING = NO in your Build Settings (https://bugs.swift.org/plugins/servlet/mobile#issue/SR-11564) **NOTE: For MacOS you must set the Branch field to lottie/macos-spm Example

If you have doubts, please, check the following links:

How to use

Creating Swift Packages

After successfully retrieved the package and added it to your project, just import Lottie and you can get the full benefits of it.


Objective-C Support

As of 3.0 Lottie has been completely rewritten in Swift!

For Objective-C support please use Lottie 2.5.3. Alternatively an Objective-C branch exists and is still active.

The official objective c branch can be found here:

Objective-C Branch

Also check out the documentation regarding it here:

iOS Migration

Data collection

The Lottie SDK does not collect any data. We provide this notice to help you fill out App Privacy Details.

Comments
  • add support for video Export usage

    add support for video Export usage

    I want to export this amazing animation into my video file with AVFoundation.

    let animationView = LAAnimationView.animationNamed("hamburger")
    
    let parentLayer: CALayer = CALayer()
    let videoLayer: CALayer = CALayer()
    videoLayer.frame = CGRect(x: 0, y: 0, width: renderSize.width, height: renderSize.height)
    parentLayer.frame = CGRect(x: 0, y: 0, width: renderSize.width, height: renderSize.height)
    parentLayer.addSublayer(videoLayer)
    
    parentLayer.addSublayer(animationView.layer)
    
    composition.animationTool = AVVideoCompositionCoreAnimationTool(postProcessingAsVideoLayer: videoLayer, in: parentLayer)
    

    but the animation does not shown in the composed video. I thought the animation begin time is not correct. It should be AVCoreAnimationBeginTimeAtZero

    can you add this feature in this amazing animation library ?

    enhancement 
    opened by alexiscn 51
  • Repeated

    Repeated "nil host used in call to allowsSpecificHTTPSCertificateForHost" in Log

    Check these before submitting:

    • [x] The issue doesn't involve an Unsupported Feature
    • [x] This issue isn't related to another open issue

    This issue is a:

    • [x] Non-Crashing Bug (Visual or otherwise)
    • [] Crashing Bug
    • [] Feature Request
    • [] Regression (Something that once worked, but doesn't work anymore)

    Which Version of Lottie are you using?

    Lottie 3.0

    What Platform are you on?

    • [] MacOS
    • [x] iOS

    What Language are you in?

    • [x] Swift
    • [] Objective-C

    Expected Behavior

    Loads animation without issues.

    Actual Behavior

    Loads animation without issues, but in the debug logs, this is what it spams me with 18 times:

    2020-09-13 04:45:20.335076-0400 AppName[8898:1527281] nil host used in call to allowsSpecificHTTPSCertificateForHost
    2020-09-13 04:45:20.335111-0400 AppName[8898:1527281] nil host used in call to allowsAnyHTTPSCertificateForHost:
    

    Code Example

    In Collection View Cell:

    var animationView = AnimationView()
    

    In cellForItemAt:

    cell.animationView.animation = Animation.named("myMandela")
    cell.animationView.layer.masksToBounds = true
    cell.animationView.contentMode = .scaleAspectFill
    cell.animationView.play()
    cell.animationView.loopMode = .loop
    cell.animationView.backgroundBehavior = .pauseAndRestore
    

    When I remove cell.animationView.animation = Animation.named("myMandela"), everything works fine—no errors in log.

    This happens on iOS 14 beta physical device & simulator using Xcode 12 Beta.

    Animation JSON

    The JSON file is enormous. I will email it.

    opened by qazwini 49
  • Lottie Swift with Xcode 11.2 Crashes when creating AnimationView

    Lottie Swift with Xcode 11.2 Crashes when creating AnimationView

    @thedrick

    • [x] The issue doesn't involve an Unsupported Feature
    • [] This issue isn't related to another open issue

    This issue is a:

    • [] Non-Crashing Bug (Visual or otherwise)
    • [x] Crashing Bug
    • [] Feature Request
    • [] Regression (Something that once worked, but doesn't work anymore)

    Which Version of Lottie are you using?

    Lottie 3.1.3 release, nut current master branch also crashes Using Lottie as a SwiftPM package

    What Platform are you on?

    • [] MacOS
    • [x] iOS

    What Language are you in?

    • [x] Swift
    • [] Objective-C

    Expected Behavior

    Actual Behavior

    Screen Shot 2019-10-31 at 16 19 04

    Code Example

    let x = AnimationView(name: "test")

    Animation JSON

    Any JSON animation from your example project

    opened by gabors 40
  • lottie crashed in AnimationContainer.init() on iOS9 device  when  used Xcode11.4

    lottie crashed in AnimationContainer.init() on iOS9 device when used Xcode11.4

    When I compiled and ran with the latest version of Xcode 11.4, there was a crash anywhere I used Lottie on iOS 9 devices

    Check these before submitting:

    • [✔️] The issue doesn't involve an Unsupported Feature
    • [✔️] This issue isn't related to another open issue

    This issue is a:

    • [] Non-Crashing Bug (Visual or otherwise)
    • [✔️] Crashing Bug
    • [] Feature Request
    • [] Regression (Something that once worked, but doesn't work anymore)

    Which Version of Lottie are you using?

    Lottie 3.1.6

    What Platform are you on?

    • [] MacOS
    • [✔️] iOS

    What Language are you in?

    • [✔️] Swift
    • [] Objective-C

    Expected Behavior

    Actual Behavior

    Code Example

    Animation JSON

    opened by EmilLiu 37
  • animation stop after enter background

    animation stop after enter background

    Lottie-ios Issue

    Hello! Sorry you are having an Issue! Please help us make Lottie better by filling everything below out with as much information as you can so we can try to reproduce and fix the issue!

    Check these before submitting:

    • [ ] Updated to the latest (2.1.3) version of Lottie
    • [ ] The issue doesnt involve and Unsupported Feature
    • [ ] This issue isnt related to another open issue

    This issue is a

    • [ ] Non-Crashing (Visual or otherwise) Bug
    • [ ] Crashing Bug
    • [ ] Feature Request
    • [ ] Regression (Something that once worked doesnt work anymore)

    What Platform are you on?

    • [ ] MacOS (Specify Platform Version)
    • [ ] iOS (Specify Platform Version)

    Expected Behavior

    (Screenshots encouraged)

    Actual Behavior

    (Screenshots encouraged)

    Code Example

    Animation JSON

    Adding the animation JSON helps us debug the issue faster!

    opened by GeekSprite 34
  • Crash : [LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:]

    Crash : [LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:]

    I got a Crashlog which is related to Lottie, But It has a very small probability of occurrence. How can I fix it.

    Thread 9 name: WebThread Thread 9 Crashed: 0 libobjc.A.dylib 0x0000000180c6db90 objc_msgSend + 16 1 CoreFoundation 0x00000001814dc618 -[__NSCFNumber isEqualToNumber:] + 28 2 CoreFoundation 0x00000001814dc5d0 -[__NSCFNumber isEqual:] + 72 3 0x000000010114be28 -[LOTAnimatorNode updateWithFrame:withModifierBlock:forceLocalUpdate:] (LOTAnimatorNode.m:41) 4 0x000000010115ba14 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] (LOTRenderGroup.m:137) 5 0x000000010115ba14 -[LOTRenderGroup updateWithFrame:withModifierBlock:forceLocalUpdate:] (LOTRenderGroup.m:137) 6 0x0000000101156c10 -[LOTLayerContainer displayWithFrame:forceUpdate:] (LOTLayerContainer.m:239) 7 0x0000000101150004 -[LOTCompositionContainer displayWithFrame:forceUpdate:] (LOTCompositionContainer.m:86) 8 0x0000000101150004 -[LOTCompositionContainer displayWithFrame:forceUpdate:] (LOTCompositionContainer.m:86) 9 0x00000001011569f8 -[LOTLayerContainer display] (LOTLayerContainer.m:214) 10 QuartzCore 0x00000001840dd814 CA::Layer::display_if_needed(CA::Transaction*) + 228 11 QuartzCore 0x00000001840dd500 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 44 12 QuartzCore 0x00000001840dcb24 CA::Context::commit_transaction(CA::Transaction*) + 252 13 QuartzCore 0x00000001840dc86c CA::Transaction::commit() + 512 14 QuartzCore 0x00000001840d5dd8 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 80 15 CoreFoundation 0x00000001815ac7b0 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 32 16 CoreFoundation 0x00000001815aa554 __CFRunLoopDoObservers + 372 17 CoreFoundation 0x00000001814d4d30 CFRunLoopRunSpecific + 416 18 WebCore 0x00000001854be558 RunWebThread(void*) + 456 19 libsystem_pthread.dylib 0x000000018125bb28 _pthread_body + 156 20 libsystem_pthread.dylib 0x000000018125ba8c _pthread_body + 0 21 libsystem_pthread.dylib 0x0000000181259028 thread_start + 4

    opened by rockleeee 32
  • Performance regression on Lottie 3

    Performance regression on Lottie 3

    Check these before submitting:

    • [x] The issue doesn't involve an Unsupported Feature
    • [x] This issue isn't related to another open issue

    This issue is a:

    • [x] Non-Crashing Bug (Visual or otherwise)
    • [ ] Crashing Bug
    • [ ] Feature Request
    • [x] Regression (Something that once worked, but doesn't work anymore)

    Which Version of Lottie are you using?

    Lottie 3.0.4

    What Platform are you on?

    • [ ] MacOS
    • [x] iOS

    What Language are you in?

    • [x] Swift
    • [ ] Objective-C

    Expected Behavior

    Same or improved performance as previous versions of Lottie when running animations

    Actual Behavior

    Running an animation on a loop using Lottie 2.5.3 consumes around 16% CPU, while running that same animation on Lottie 3.0.4 consumes around 43%

    Code Example

    Animation JSON

    Attached file

    opened by manolosavi 28
  • Using LOTAnimationView in Interface Builder

    Using LOTAnimationView in Interface Builder

    I've been trying to figure out how to use a LOTAnimationView in Interface Builder so I can be consistent with how the rest of my app is set up. I'd also like to take advantage of auto layout in IB instead of having to hard code a frame for any LOTAnimationView I use.

    I'd like to propose implementing initWithCoder: on LOTAnimationView and a helper method to assign an animation to said view.

    I could be thinking about this incorrectly if so I'd love to hear how I'd use a LOTAnimationView in IB. Otherwise, would you be open to me submitting a PR? Thanks for reading!

    Code Example

    - (instancetype)initWithCoder:(NSCoder *)aDecoder {
      self = [super initWithCoder:aDecoder];
      if (self) {
        [self _commonInit];
      }
      return self;
    }
    
    - (void)setAnimationNamed:(nonnull NSString *)animationName {
      LOTComposition *comp = [LOTComposition animationNamed:animationName inBundle:[NSBundle mainBundle]];
    
      [self _initializeAnimationContainer];
      [self _setupWithSceneModel:comp];
    }
    

    Use

    • Add a view to a nib/storyboard set its class to LOTAnimationView
    • Add an outlet to that view
    • Call the helper method on your outlet.
    [self.myAnimationView setAnimationNamed:@"loading_animation"];
    [self.myAnimationView play];
    

    Check these before submitting:

    • [x] Updated to the latest version of Lottie (2.1.5)
    • [x] The issue doesn't involve an Unsupported Feature
    • [x] This issue isn't related to another open issue

    This issue is a:

    • [x] Feature Request

    What Platform are you on?

    • [x] iOS
    opened by Xeaza 25
  • Text rendering

    Text rendering

    From what I can tell lottie does not support text rendering. I can't find an existing issue about it though. Is it being worked on? Can we keep this issue open until it's fixed, so others know the status?

    enhancement 
    opened by jlongster 23
  • AnimationView init blocks main thread for a noticeable amount of time

    AnimationView init blocks main thread for a noticeable amount of time

    Check these before submitting:

    • [x] The issue doesn't involve an Unsupported Feature
    • [] This issue isn't related to another open issue

    This issue is a:

    • [x] Non-Crashing Bug (Visual or otherwise)
    • [] Crashing Bug
    • [] Feature Request
    • [x] Regression (Something that once worked, but doesn't work anymore)

    Which Version of Lottie are you using?

    Lottie 3.0

    What Platform are you on?

    • [] MacOS
    • [x] iOS

    What Language are you in?

    • [x] Swift
    • [] Objective-C

    Expected Behavior

    Initializing an AnimationView should not block the main thread for a significant amount of time. The previous version LOTAnimationView did not block the main thread on init.

    Actual Behavior

    Initializing an AnimationView blocks the main thread long enough where it appears that the app has hanged.

    Code Example

    convenience init(fileUrl: URL, imageProvider: AnimationImageProvider? = nil, animationCache: AnimationCacheProvider? = LRUAnimationCache.sharedCache) {
        let animation = Animation.fileUrl(fileUrl, animationCache: animationCache)
        let provider = imageProvider ?? FilepathImageProvider(filepath: fileUrl.deletingLastPathComponent().path)
        self.init(animation: animation, imageProvider: provider)
    }
    let animationView = AnimationView(fileUrl: url)
    

    Animation JSON

    treasurechest-animation1.json.zip

    opened by tmg-mlyons 22
  • Add option to replace colors

    Add option to replace colors

    The Android SDK (https://github.com/airbnb/lottie-android) seems to have support for replacing colors in an animation through filters. Would be nice to get the same functionality for the iOS SDK. One use case would be if you want to use the same animation in several different apps with distinct branding and colors. Currently this can only be achieved by having duplicated JSONs (overhead) or hot-swapping the colors in the JSON string at runtime (brittle).

    enhancement 
    opened by Johennes 22
  • Core Animation Engine - Set currentFrame when animation is finished

    Core Animation Engine - Set currentFrame when animation is finished

    For the Core Animation Engine the currentFrame is calculated based on the animationProgress placeholder animation. The animationProgress value is never copied from the presentation layer to the model layer.

    Because of that value of currentFrame is lost once the place holder animation has reached completion and was automatically removed.

    This PR changes the placeholder animation to remain and instead be manually removed in the animationDidStop(..) delegate. That way it is possible to persist the currentFrame value.

    Attempts to solve issues: #1877 #1865

    | Before | After | | ------- | ---- | |

    Notes #1877 is not fully fixed as there still is an issue when setting the switch to off from the start. The wrong frame is shown.

    Warning I'm pretty certain that there are cases that I have missed and that I have now broken. 🙇‍♂️

    opened by nevil 2
  • Dynamic refresh rate issue

    Dynamic refresh rate issue

    Noticed on iPhone 13 Pro (with dynamic screen refresh rate), SwiftUI project, iOS 16.1.

    When nothing happens on screen for a couple of seconds, iOS lowers the refresh rate to a 10-12 hertz. Hence the animation have only 10-12fps.

    • The issue only appears when a custom animationSpeed < 1 is applied;
    • If any other animation is running on screen (including notifications and other system stuff), the issue is not reproducing;
    • If screen recording is enabled, the issue is not reproducing (feels like screen recording forces 60fps system-wide).

    Which Version of Lottie are you using?

    Lottie 4.0.1, CoreAnimation rendering engine

    Expected Behavior

    Forcing system to sustain normal refresh rate

    Actual Behavior

    Dropping frames as screen refresh rate is lowered

    can't reproduce 
    opened by konstantin-tcherkashin 1
  • Unable to use v4.0.1 using carthage

    Unable to use v4.0.1 using carthage

    Which Version of Lottie are you using?

    Trying to use Lottie 4.0.1

    Expected Behavior

    Should build xcframework

    Actual Behavior

    Fails with error A shell task (/usr/bin/xcrun xcodebuild -project /Users/aakarsh/Desktop/xyz/Lottie.xcodeproj CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES -list) failed with exit code 74: xcodebuild: error: Could not resolve package dependencies: Package.resolved file is corrupted or malformed; fix or delete the file to continue: unsupported schema version 2

    Animation JSON

    can't reproduce 
    opened by aakarsh-sasi 5
  • Old iOS versions have rendering issues [iOS 13]

    Old iOS versions have rendering issues [iOS 13]

    Which Version of Lottie are you using?

    Lottie 4.0.1 commit 0ceb3ece

    Expected Behavior

    CleanShot 2022-12-26 at 14 31 51@2x

    Actual Behavior

    wrong

    This issue happens for iOS 13 devices when I use LottieConfiguration(renderingEngine: .automatic). When I use LottieConfiguration(renderingEngine: .mainThread) everything goes back to normal. Animation works fine on iOS16 with both rendering engines.

    can't reproduce 
    opened by zabolotiny 2
  • AnimatedSwitch behaves differently with coreAnimationEngine vs mainThreadEngine

    AnimatedSwitch behaves differently with coreAnimationEngine vs mainThreadEngine

    Which Version of Lottie are you using?

    Latest commit 3b907922757b550484405d6d708089d1941a9c47

    Description

    We are using an AnimatedSwitch with the default settings for the progress for each state. We do not call setProgressForState(...)

      fileprivate var onStartProgress: CGFloat = 0
      fileprivate var onEndProgress: CGFloat = 1
      fileprivate var offStartProgress: CGFloat = 1
      fileprivate var offEndProgress: CGFloat = 0
    

    When animating back from on to off state the animation does not behave as expected. I believe the root cause is that currentFrame is 0 at this point for the coreAnimationEngine but not for the mainThreadEngine.

    Because of that, in addNewAnimationForContext(...) the playFrom value will be forced to 0:

            switch loopMode {
            // When playing exactly once (and not looping), we can just set the
            // `playFrom` time to be the `currentFrame`. Since the animation duration
            // is based on `playFrom` and `playTo`, this automatically truncates the
            // duration (so the animation stops playing at `playFrom`).
            case .playOnce:
              animationContext.playFrom = currentFrame
    

    With the mainThreadEngine the currentFrame will be set to the expected value in didAnimationStop but this is not the case for the coreAnimationEngine.

        if let animationLayer = animationLayer, let key = animationKey {
          animationLayer.removeAnimation(forKey: key)
          if flag {
            animationLayer.currentFrame = (anim as! CABasicAnimation).toValue as! CGFloat
          }
        }
    

    Temporary workaround, not sure if it is accurate :-) Force setting the currentProgress also for coreAnimationEngine

    -        // For the Main Thread rendering engine, we freeze the animation at the expected final progress
    -        // once the animation is complete. This isn't necessary on the Core Animation engine.
    -        if finished, !(self.animationView.animationLayer is CoreAnimationLayer) {
    +       if finished {
                self.animationView.currentProgress = finalProgress
            }
    

    Expected Behavior

    https://user-images.githubusercontent.com/36905/209103417-eff097ab-a3ff-4519-9443-ea5dd0d17a7c.mp4

    Actual Behavior

    https://user-images.githubusercontent.com/36905/209103485-d7eadef8-a282-43eb-8b40-ffc7ddf96ca4.mp4

    Animation JSON

    myListButton.json.zip

    opened by nevil 1
  • Animation looks differently with different rendering mode

    Animation looks differently with different rendering mode

    Hello! I'm trying Lottie 4.0.1 and animation broken with rendering mode automatic. I attached json file and screenshot how this file looks: Web Preview: image

    iOS with mainThread: image

    iOS with automatic rendering mode: image

    As you can see on the Web Preview animation looks cool, but on iOS with mainThread there is some glitches on the top, on iOS with automatic rendering mode animation is broken.

    NoConnectionLight.json.zip

    bug 
    opened by Banck 0
Releases(4.0.1)
  • 4.0.1(Dec 8, 2022)

    4.0.1 fixes an issue in 4.0.0 where the install could fail due to issues with Git LFS: #1830, #1834.

    We now publish xframework binaries as a part of our release process: https://github.com/airbnb/lottie-ios/discussions/1807#discussioncomment-4346438

    Major changes in Lottie 4.0

    Learn more about this release: Announcing Lottie 4.0 for iOS on the Airbnb Tech Blog

    • 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.
    • 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.
    • Backwards compatibility typealiases for Animation, AnimationView, Color, Vector1D, Vector2D, and Vector3D, which were introduced in Lottie 3.5.0, have been removed to resolve conflicts with types in Apple frameworks. These types are now named LottieAnimation, LottieAnimationView, LottieColor, LottieVector1D, LottieVector2D, and LottieVector3D.

    • The default LottieBackgroundBehavior used by LottieAnimationView is now .pauseAndRestore instead of pause.

    • Lottie for iOS now supports the dotLottie file format.

    • The library's minimum-supported Swift version is now Swift 5.5.

    Source code(tar.gz)
    Source code(zip)
    Lottie.xcframework.zip(8.64 MB)
  • 4.0.0(Dec 6, 2022)

    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.
    • 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.
    • Backwards compatibility typealiases for Animation, AnimationView, Color, Vector1D, Vector2D, and Vector3D, which were introduced in Lottie 3.5.0, have been removed to resolve conflicts with types in Apple frameworks. These types are now named LottieAnimation, LottieAnimationView, LottieColor, LottieVector1D, LottieVector2D, and LottieVector3D.

    • The default LottieBackgroundBehavior used by LottieAnimationView is now .pauseAndRestore instead of pause.

    • 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 https://github.com/airbnb/lottie-ios/pull/1764
    • Fix issue where inverted mask layer was clipped incorrectly by @calda in https://github.com/airbnb/lottie-ios/pull/1763
    • Bump to 4.0.0, remove backwards compatibility typealiases by @calda in https://github.com/airbnb/lottie-ios/pull/1768
    • Update LottieBackgroundBehavior.default from .pause to .pauseAndRestore for Main Thread rendering engine by @calda in https://github.com/airbnb/lottie-ios/pull/1770
    • Adds ability to not play the frame of the end marker (#1758) by @lennartstolz in https://github.com/airbnb/lottie-ios/pull/1772
    • Change LottieAnimationHelpers default animation cache to LRUAnimationCache.shared (#1773) by @pejato in https://github.com/airbnb/lottie-ios/pull/1778
    • Update LottieConfiguration to use DecodingStrategy.dictionaryBased by default by @marcelofabri in https://github.com/airbnb/lottie-ios/pull/1777
    • Allow customizing default AnimationCacheProvider by @marcelofabri in https://github.com/airbnb/lottie-ios/pull/1779
    • Replace LRUAnimationCache with a thread-safe NSCache-based cache by @marcelofabri in https://github.com/airbnb/lottie-ios/pull/1783
    • Update minimum Swift version to 5.5 by @calda in https://github.com/airbnb/lottie-ios/pull/1787
    • Adds .lottie file load capability to LottieAnimation by @eharrison in https://github.com/airbnb/lottie-ios/pull/1785
    • Add Rounded Corners by @johnny-duo in https://github.com/airbnb/lottie-ios/pull/1795
    • Add rounded corner support to Core Animation rendering engine by @calda in https://github.com/airbnb/lottie-ios/pull/1796
    • Add support for animating startPoint and endPoint of radial gradients by @calda in https://github.com/airbnb/lottie-ios/pull/1798
    • Update Core Animation rendering engine to use device RGB color space by @calda in https://github.com/airbnb/lottie-ios/pull/1801
    • added mask to bounds flag by @BugorBN in https://github.com/airbnb/lottie-ios/pull/1814
    • Add completion callbacks to LottieAnimationView DotLottie initializers by @calda in https://github.com/airbnb/lottie-ios/pull/1810
    Source code(tar.gz)
    Source code(zip)
  • 3.5.0(Oct 11, 2022)

    Note: Lottie 3.4.0 added a new rendering engine powered by Core Animation. Please try it out and let us know if you encounter any issues! It will be enabled by default in Lottie 4.0, which we plan on releasing later this month. More information is available in this announcement: https://github.com/airbnb/lottie-ios/discussions/1627

    Lottie 3.5.0

    This version renames several public types, to resolve conflicts with types in Apple frameworks (https://github.com/airbnb/lottie-ios/issues/1420):

    • Lottie.Animation has been renamed to LottieAnimation, to resolve a conflict with SwiftUI.Animation
    • Lottie.Color has been renamed to LottieColor, to resolve a conflict with SwiftUI.Color
    • Lottie.Vector3D has been renamed to LottieVector3D, to resolve a conflict with Spatial.Vector3D

    For consistency with these new names, we have also renamed the following public types:

    • Lottie.AnimationView has been renamed to LottieAnimationView
    • Lottie.Vector1D has been renamed to LottieVector1D
    • Lottie.Vector2D has been renamed to LottieVector2D.

    For backwards compatibility Lottie 3.5.0 includes typealiases for the old names, which map to the new names. These typealiases are marked as deprecated and include fix-its to update call-sites to the new name.

    Lottie 4.0

    We plan on releasing Lottie 4.0 in the next few weeks. In Lottie 4.0 we will remove the compatibility typealiases (for Animation, AnimationView, Color, etc) , so code using the old names will no longer compile. This will resolve the naming conflicts with SwiftUI types. Consider updating to Lottie 3.5.0 first, applying the fix-its recommended by the deprecation warnings, and then update to Lottie 4.0 once it is released (Lottie 4.0 will no longer include deprecation warnings with fix-its). Thank you for bearing with us through this transition process!

    Lottie 4.0 will also make the new Core Animation rendering engine (added in Lottie 3.4.0) the default rendering engine option. As mentioned above, please try out the new rendering engine if you haven't yet and let us know if you encounter any issues! We've been hard at work fixing issues reported by the community.

    Known issues

    If your application has a storyboard that references AnimationView, it may crash when using Lottie 3.5.0 (https://github.com/airbnb/lottie-ios/issues/1771). The fix for this issue is to update all references of AnimationView to LottieAnimationView and update all references of Animation to LottieAnimation. This should be resolved in Lottie 4.0, where code using the old names will no longer compile.

    Source code(tar.gz)
    Source code(zip)
  • 3.4.4(Oct 7, 2022)

    Note: Lottie 3.4.0 added a new rendering engine powered by Core Animation. Please try it out and let us know if you encounter any issues! It will be enabled by default in Lottie 4.0, which we plan on releasing later this month. More information is available in this announcement: https://github.com/airbnb/lottie-ios/discussions/1627

    What's Changed

    • Updated Main Thread rendering engine to use warn (print) instead of assertionFailure when detecting unsupported usage of repeaters (https://github.com/airbnb/lottie-ios/pull/1754)
    • Fixed issue where manually-interpolated shape animations would ignore time remapping (https://github.com/airbnb/lottie-ios/pull/1757)
    • Added marker duration support (https://github.com/airbnb/lottie-ios/pull/1749)
    • Updated animationDidSet to be open (https://github.com/airbnb/lottie-ios/pull/1746)
    • Updated AnimatedSwitch and AnimatedButton to allow overrides of begin/end tracking in subclasses (https://github.com/airbnb/lottie-ios/pull/1747)
    • Added animateUpdateWhenChangingAnimation flag to AnimatedControl (https://github.com/airbnb/lottie-ios/pull/1750)
    Source code(tar.gz)
    Source code(zip)
  • 3.4.3(Aug 29, 2022)

    Note: Lottie 3.4.0 added a new rendering engine powered by Core Animation. Please try it out and let us know if you encounter any issues! It will be enabled by default in a future version of Lottie. More information is available in this announcement: https://github.com/airbnb/lottie-ios/discussions/1627

    New Features

    • Updated Core Animation rendering engine to support TextProviders (https://github.com/airbnb/lottie-ios/pull/1723)
    • Updated Core Animation rendering engine to support time stretch in pre-comp layers (https://github.com/airbnb/lottie-ios/pull/1726)
    • Updated Animation.loadedFrom method to support using a custom URLSession (https://github.com/airbnb/lottie-ios/pull/1733)

    Bug fixes

    • Fixed performance issue with line dash patterns (https://github.com/airbnb/lottie-ios/pull/1736)
    • Fixed race condition in Core Animation rendering engine's playbackState property (https://github.com/airbnb/lottie-ios/pull/1727)
    • Fixed issue where Core Animation rendering engine would ignore hidden flag on some shape items (https://github.com/airbnb/lottie-ios/pull/1728)
    • Fixed issue where Core Animation rendering engine would ignore CAGradientLayer locations / color stops (https://github.com/airbnb/lottie-ios/pull/1734)
    • Fixed issue where Core Animation rendering engine would not render alpha gradient (https://github.com/airbnb/lottie-ios/pull/1737)
    Source code(tar.gz)
    Source code(zip)
  • 3.4.2(Aug 16, 2022)

    Note: Lottie 3.4.0 added a new rendering engine powered by Core Animation. Please try it out and let us know if you encounter any issues! It will be enabled by default in a future version of Lottie. More information is available in this announcement: https://github.com/airbnb/lottie-ios/discussions/1627

    New features

    • Added support for Repeater shape items to Core Animation rendering engine (https://github.com/airbnb/lottie-ios/pull/1688)
    • Added support for inverted matte layers to Core Animation rendering engine (https://github.com/airbnb/lottie-ios/pull/1712)
    • Added fillMode support to GradientFill shape items (https://github.com/airbnb/lottie-ios/pull/1702)
    • Added support for non-integer animation widths/heights (https://github.com/airbnb/lottie-ios/pull/1694)

    Bug fixes

    • Fixed CocoaPods installation issue by removing .swift-version file (https://github.com/airbnb/lottie-ios/pull/1674)
    • Changeed default behavior when bundle image is not found from assertionFailure to warn (https://github.com/airbnb/lottie-ios/pull/1680)
    • Fixed issue where isAnimationPlaying would be incorrect when using LottieLoopMode.playOnce (https://github.com/airbnb/lottie-ios/pull/1682)
    • Fixed regression where InvertedMatteLayers wouldn't animate when using Main Thread rendering engine (https://github.com/airbnb/lottie-ios/pull/1684)
    • Core Animation rendering engine now respects LayerModel.hidden and ShapeItem.hidden flags (https://github.com/airbnb/lottie-ios/pull/1689)
    • Fixed where strokes would not appear under certain conditions (https://github.com/airbnb/lottie-ios/pull/1691)
    • Core Animation rendering engine now supports animating multiple properties of shape bezier paths (https://github.com/airbnb/lottie-ios/pull/1690)
    • Core Animation rendering engine now correctly Ignores masks with MaskMode.none (https://github.com/airbnb/lottie-ios/pull/1693)
    • Fixed issue where Core Animation engine would render negative stroke offsets incorrectly (https://github.com/airbnb/lottie-ios/pull/1698)
    • Improved shape fill behavior for overlapping shapes when using Core Animation rendering engine (https://github.com/airbnb/lottie-ios/pull/1699)
    • Fixed issue that caused text layer descenders to be cut off when using some fonts https://github.com/airbnb/lottie-ios/pull/1697
    • RenderingEngineOption.automatic now falls back to the Main Thread rendering engine when attempting to apply Trim to Fill (unsupported by Core Animation rendering engine) (https://github.com/airbnb/lottie-ios/pull/1706)
    • Fixed bug in AnimationView.play(fromFrame:toFrame:) with fromFrame: nil (https://github.com/airbnb/lottie-ios/pull/1707)
    • Fixed issue where some spatial keyframes would be ignored by Core Animation rendering engine (https://github.com/airbnb/lottie-ios/pull/1714)
    • Fixed issue where certain AnimationKeypaths were not applied correctly by Core Animation rendering engine (https://github.com/airbnb/lottie-ios/pull/1715)
    • Fixed issue where stroke with dash pattern could unexpectedly be rendered as pills instead of circles (https://github.com/airbnb/lottie-ios/pull/1718)
    • Fixed issue where large GradientFill / GradientStroke would be cut off when using Core Animation rendering engine (https://github.com/airbnb/lottie-ios/pull/1721)
    Source code(tar.gz)
    Source code(zip)
  • 3.4.1(Jul 26, 2022)

    General

    New features

    • Added configuration: LottieConfiguration = .shared option to more AnimationView initializers (https://github.com/airbnb/lottie-ios/pull/1654)
    • AnimatedSwitch and AnimatedButton are now accessibility elements by default (https://github.com/airbnb/lottie-ios/pull/1637, https://github.com/airbnb/lottie-ios/pull/1639)

    Bug fixes

    • Fixed issue where LottieLogger.shared.assertionFailure would unexpectedly crash in -O / release builds (https://github.com/airbnb/lottie-ios/pull/1665)
    • Fixed Carthage support on macOS (https://github.com/airbnb/lottie-ios/pull/1641)

    Core Animation rendering engine

    Reminder: Lottie 3.4.0 added a new rendering engine powered by Core Animation. Please try it out and let us know if you encounter any issues! It will be enabled by default in a future version of Lottie. More information is available in this announcement: https://github.com/airbnb/lottie-ios/discussions/1627

    New features

    • Added support for mixed isHold / !isHold keyframes (https://github.com/airbnb/lottie-ios/pull/1644)
    • Added support for gradients with alpha values (https://github.com/airbnb/lottie-ios/pull/1634, https://github.com/airbnb/lottie-ios/pull/1640)
    • Added support for negative speed values (https://github.com/airbnb/lottie-ios/pull/1660)

    Bug fixes

    • Fixed issue where ShapeLayer with no Groups would fail to render (https://github.com/airbnb/lottie-ios/pull/1646)
    • Fixed issue where some shape fills would be applied incorrectly (https://github.com/airbnb/lottie-ios/pull/1647)
    • Fixed issue where LottieBackgroundBehavior would unexpectedly be applied even when the animation was paused (#1653)
    Source code(tar.gz)
    Source code(zip)
  • 3.4.0(Jul 6, 2022)

    New features

    Bug fixes

    Source code(tar.gz)
    Source code(zip)
  • 3.3.0(Dec 14, 2021)

    Full Changelog: https://github.com/airbnb/lottie-ios/compare/3.2.3...3.3.0

    • Increased minimum deployment target to iOS 11
    • Added Swift Package Manager support for macOS and tvOS (#1428)
    • Added parsing support for layers with no index (ind) property (#1433)
    • AnimatedSwitch and AnimatedButton are now open instead of final (#1431)
    • Fixed issue where shape layers could render at a low resolution (#1436)
    • Fixed issue where AnimationView's transform could animate incorrectly (#1395)

    Known issues:

    • 3.3.0 doesn't support Carthage (#1448, fixed on master and in future releases)
    Source code(tar.gz)
    Source code(zip)
  • 3.2.3(May 14, 2021)

    Adds a fix for a bug that caused precomposition layers to have zero sized bounds. This bug furth broke alpha inverted masks in precomposition layers.

    Source code(tar.gz)
    Source code(zip)
  • 3.2.2(Apr 30, 2021)

  • 3.2.1(Feb 8, 2021)

  • 3.2.0(Feb 1, 2021)

  • 3.1.9(Nov 2, 2020)

    • Add isAnimationPlaying to CompatibleAnimationView
    • change id accessor from internal to public
    • Updates to Text Rendering
    • fix: empty layerID causes crash
    • Rewrite Text Rendering to support Line Height + Added Font Provider
    • fixed #944 Images from Assets.xcassets are not loading
    • Work Around Xcode 12 Beta 1 Compilation Issues
    • Add isAnimationQueued to determine if animation will start when this view is added to a window
    • Changed ACL for animationView to public in AnimatedControl
    Source code(tar.gz)
    Source code(zip)
  • 3.1.8(Apr 23, 2020)

  • 3.1.6(Jan 27, 2020)

    • Swift 5 (Thanks https://github.com/airbnb/lottie-ios/commits?author=thejohnlima !)
    • Gradient Value Provider support (Thanks https://github.com/airbnb/lottie-ios/commits?author=enriquebk !)
    • Precomp clipping fix
    • Swift packages fixes
    • Layout bug fix (Thanks https://github.com/airbnb/lottie-ios/commits?author=MariuszWisniewski )
    • Crashing remove observer bug fix (Thanks https://github.com/airbnb/lottie-ios/commits?author=zenangst )
    Source code(tar.gz)
    Source code(zip)
  • 3.1.5(Nov 4, 2019)

  • 3.1.4(Nov 1, 2019)

  • 3.1.3(Sep 13, 2019)

    • Various bug fixes
    • Added new API for cropping animations at runtime viewportFrame
    • Added new API for enabling/disabling nodes at runtime setNodeIsEnabled(isEnabled:, keypath:)
    Source code(tar.gz)
    Source code(zip)
  • 3.1.2(Sep 13, 2019)

  • 3.1.1(Jul 1, 2019)

  • 3.1.0(May 29, 2019)

  • 3.0.7(May 29, 2019)

  • 3.0.4(Apr 9, 2019)

  • 3.0.3(Mar 22, 2019)

  • 3.0.2(Mar 21, 2019)

    • Fix for crash with using AnimationView in a Storyboard
    • Fixed a bug with Trim Paths
    • Fixed a bug with AnimatedSwitch
    • Added support for Base64 images encoded into the JSON
    • Added support for setting animation to nil
    • Added a fix for adding custom views to animation
    • Added a fix that would cause animation to not play if play was called before the animation had moved to the window.
    Source code(tar.gz)
    Source code(zip)
  • 3.0.1(Mar 20, 2019)

  • 3.0.0(Mar 17, 2019)

    Lottie 3.0 Release Notes

    Lottie 3.0 is a complete rewrite of Lottie in Swift 4.0! Read More Here

    In addition to completely rebuilding the entire animation engine, several new features have been added.

    Please Note that the Api and Class names have changed slightly. (No more LOT prefix).

    • New documentation fully covers Lottie API.
    • Text Rendering (No Glyphs) now supported
    • Gradient Stroke now supported
    • Individual Trim paths now supported
    • Alpha inverted masks now supprted
    • Marker support
    • Skew now supported
    • Fully support all UIView content modes
    • New api for dynamic properties.
    • Animation now fully supports Codable. You can decode and encode JSON data.
    • Animated Button component
    • New more flexible ImageProvider
    • Play animations in their native framerate
    • Read animation progress in realtime
    • Spatial Interpolation now more accurate
    • Added API for getting animation properties
    • Rewritten render system, fixing many bugs.
    • JSON Decoding supports Default values
    • JSON Coding unit testing
    • Trim paths are now more accurate
    • Bug fixes, bug fixes, bug fixes.
    Source code(tar.gz)
    Source code(zip)
  • 2.5.3(Mar 6, 2019)

  • 2.5.2(Oct 4, 2018)

    -Various bug fixes from the community

    -Fixed a bug that prevented a playing animation from resuming after the application was backgrounded.

    Source code(tar.gz)
    Source code(zip)
Simple calculation to render cheap water effects.

Water Simple calculation to render cheap water effects. This simple project demonstrates : how to use Metal draw compute shader, or known as 'kernal f

Xue Yu 381 Sep 20, 2022
A Swift library to take the power of UIView.animateWithDuration(_:, animations:...) to a whole new level - layers, springs, chain-able animations and mixing view and layer animations together!

ver 2.0 NB! Breaking changes in 2.0 - due to a lot of requests EasyAnimation does NOT automatically install itself when imported. You need to enable i

Marin Todorov 3k Dec 27, 2022
(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.

wobbly See Wobbly in action (examples) Add a drop of honey ?? to your project wobbly has a bunch of cool, fun, and easy to use iOS animations for you

Sagaya Abdulhafeez 150 Dec 23, 2021
(Animate CSS) animations for iOS. An easy to use library of iOS animations. As easy to use as an easy thing.

wobbly See Wobbly in action (examples) Add a drop of honey ?? to your project wobbly has a bunch of cool, fun, and easy to use iOS animations for you

Sagaya Abdulhafeez 150 Dec 23, 2021
A collection of animations for iOS. Simple, just add water animations.

DCAnimationKit A collection of animations for iOS Simply, just add water! DCAnimationKit is a category on UIView to make animations easy to perform. E

Dalton 797 Sep 23, 2022
The Effects Library allows developers to create sophisticated and realistic particle systems such as snow, fire, rain, confetti, fireworks, and smoke with no or minimal effort.

The Effects Library allows developers to create sophisticated and realistic particle systems such as snow, fire, rain, confetti, fireworks, and smoke with no or minimal effort.

Stream 182 Jan 6, 2023
Various view's effects for iOS, written in Swift. Allows you to animate views nicely with easy to use extensions

Various view's effects for iOS, written in Swift. Allows you to animate views nicely with easy to use extensions. Every animation is randomized. Currently supported animations:

Artur Rymarz 23 Aug 23, 2022
Awesome IOS Styling with SwiftUI, Animation, Effects, Gesture ⭐️

Awesome SwiftUI Styling with SwiftUI ⭐️ This repository is dedicated to IOS styling using SwiftUI. (often using Other Libraries.) I started collecting

SeungYeub Baek 1 Apr 5, 2022
A CocoaPod that simplifies creation of the particle effects.

CRParticleEffect A CocoaPod that simplifies creation of particle effects. Supplied with UIPanGestureRecognizer subclass. We know how to add some visua

Cleveroad 350 Mar 8, 2022
A library to simplify iOS animations in Swift.

Updated for Swift 4.2 Requires Xcode 10 and Swift 4.2. Installation Drop in the Spring folder to your Xcode project (make sure to enable "Copy items i

Meng To 14k Jan 3, 2023
A library of custom iOS View Controller Animations and Interactions.

RZTransitions is a library to help make iOS7 custom View Controller transitions slick and simple. Installation CocoaPods (Recommended) Add the followi

Rightpoint 1.9k Nov 20, 2022
A library for fancy iOS animations that you will definitely love.

EazelAnimationsKit Table of Contents Introduction Animations Usage Installation Contribution Authors Introduction The drive for developing this animat

Eazel 7 Dec 13, 2022
Swift library for choreographing animations on the screen.

Spruce iOS Animation Library (and Android) What is it? Spruce is a lightweight animation library that helps choreograph the animations on the screen.

WillowTree, LLC 3.4k Jan 3, 2023
SamuraiTransition is an open source Swift based library providing a collection of ViewController transitions featuring a number of neat “cutting” animations.

SamuraiTransiton is a ViewController transition framework in Swift. It is an animation as if Samurai cut out the screen with a sword. transition types

hachinobu 273 Dec 29, 2022
Physics-based animations for iOS, tvOS, and macOS.

Advance An animation library for iOS, tvOS, and macOS that uses physics-based animations (including springs) to power interactions that move and respo

Tim Donnelly 4.5k Dec 29, 2022
Sample way of integrating animations into a design system for iOS app projects.

Animations in Design System The project presents a sample way of integrating animations into a design system for iOS developers. Project setup A sampl

Bulat Khabirov 1 Nov 26, 2021
Easily build advanced custom animations on iOS.

INTUAnimationEngine makes it easy to build advanced custom animations on iOS. INTUAnimationEngine provides a friendly interface to drive custom animat

Intuit 1.1k Dec 14, 2022
MotionBlur allows you to add motion blur effect to iOS animations.

MotionBlur MotionBlur allows you to add motion blur effect to your animations (currently only position's change). See the accompanying blog post to le

Arek Holko 1.5k Nov 3, 2022
Wave is a spring-based animation engine for iOS that makes it easy to create fluid, interruptible animations that feel great.

Wave is a spring-based animation engine for iOS and iPadOS. It makes it easy to create fluid, interactive, and interruptible animations that feel great.

Janum Trivedi 1.2k Jan 8, 2023