leonardo-ferreira07 / dotlottieLoader-ios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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
DotLottieLoader.dotLottie(fromJsonLottieAt: URL(string: "https://assets7.lottiefiles.com/packages/lf20_6k4jsmai.json")!) { dotLottieFileUrl in
    // share or play `dotLottieFileUrl` using [DotLottie library](https://github.com/dotlottie/dotlottie-ios) 
}

Author

Evandro Harrison Hoffmann | evandro.hoffmann@gmail.com

License

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

About

License:MIT License


Languages

Language:Swift 94.4%Language:Ruby 5.6%