Lottie

TAG:  Animation , Layout , Design , Swift , App information , Help , IntroView , Lottie, Android , React native , motion , ios , iphone animation, like, button animation , Rating , Face detect

Classification:  Lottie

Platform:  IOS

Language:  Swift / Android / React Native

Device:
iPhone / iPad / Android

Licence:
Apache

Download

Installation

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 **NOTE: For MacOS you must set the Branch field to lottie/macos-spm 

If you have doubts, please, check the following links:
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:
Also check out the documentation regarding it here:


0 Comments: