Skip to content
This repository has been archived by the owner on Dec 16, 2024. It is now read-only.

dotlottie/dotlottieLoader-ios

Folders and files

NameName
Last commit message
Last commit date

Latest commit

038cab5 · Apr 23, 2022

History

35 Commits
Aug 6, 2020
Oct 20, 2021
Apr 23, 2022
Aug 6, 2020
Aug 5, 2020
Aug 5, 2020
Aug 5, 2020
Oct 12, 2021
Oct 12, 2021
Jun 28, 2021
Aug 5, 2020
Jun 22, 2021

Repository files navigation

dotLottieLoader

CI Status Version License Platform

Introducing dotLottie

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 9
  • 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.4")

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.