Skip to content

dotlottie/dotlottieLoader-ios

Repository files navigation

dotLottieLoader

CI Status Version License Platform

Introducing dotLottie

⚠️ This repository is not longer maintained. Please use the latest dotlottie-ios here.

dotLottie is an open-source file format that aggregates one or more Lottie files and their associated resources into a single file. They are ZIP archives compressed with the Deflate compression method and carry the file extension of ".lottie".

dotLottieLoader

dotLottieLoader is a library to help downloading and deflating a .lottie file, giving access to the animationUrl as well as included images.

View documentation, FAQ, help, examples, and more at dotlottie.io

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

  • Swift 5.0
  • iOS 11
  • macOS 10.12
  • tvOS 10.0
  • watchOS 6.0

Installation

Cocoapods

dotLottieLoader-ios is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'dotLottieLoader'

Swift Package Manager

.package(url: "https://github.com/dotlottie/dotLottieLoader-ios.git", from: "0.1.8")

Using dotLottie

import dotLottieLoader
Enabling log
DotLottieUtils.isLogEnabled = true
Loading from a local file
DotLottieLoader.load(name: "animation") { (dotLottieFile) in
    // use dotLottieLoader.animationUrl to load the lottie animation as you normally would
}
Loading a remote file
DotLottieLoader.load(from: URL(string:"https://dotlottie.io/sample_files/animation.lottie")!){ (dotLottieFile) in
    // use dotLottieLoader.animationUrl to load the lottie animation as you normally would
}
Creating .lottie file from JSON animation file
var creator = DotLottieCreator(animationUrl: URL(string: "https://assets7.lottiefiles.com/private_files/lf30_p25uf33d.json")!)
creator.create { url in
    // use url to dotLottie
}

Author

Evandro Harrison Hoffmann | [email protected]

License

dotLottieLoader-ios is available under the MIT license. See the LICENSE file for more info.