iOS/MacOS
Last updated
Last updated
Lottie Uses Cocoapods, Carthage, Static and Dynamic modules. Lottie supports iOS 8+ and MacOS 10.10+
You can pull the and include the Lottie.xcodeproj to build a dynamic or static library.
Get Add the pod to your podfile
run
After installing the cocoapod into your project import Lottie with
Objective C
#import <Lottie/Lottie.h>
Swift
import Lottie
Get
Add Lottie to your Cartfile
run
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.
The iOS Example App demos several of the features of Lottie
The Lottie Viewer for MacOS allows you to drag and drop JSON files to open, play, scrub and loop animations. This app is backed by the same animation code as the iOS app, so you will get an accurate representation of Mac and iOS animations.
Lottie animations can be loaded from bundled JSON or from a URL To bundle JSON just add it and any images that the animation requires to your target in xcode.
If you are working with multiple bundles you can use.
Or you can load it programmatically from a NSURL
Lottie supports the iOS UIViewContentModes
aspectFit, aspectFill and scaleFill
You can also set the animation progress interactively.
Or you can play just a portion of the animation:
Lottie animations can be loaded from bundled JSON or from a URL To bundle JSON just add it and any images that the animation requires to your target in xcode.
If your animation is in another bundle you can use
Or you can load it asynchronously from a URL
You can also set the animation progress interactively.
Or you can play just a portion of the animation:
Clone this repo and try out The repo can build a MacOS Example and an iOS Example
The animation Explorer allows you to scrub, play, loop, and resize animations. Animations can be loaded from the app bundle or from using the built in QR Code reader.
Clone this repo and try out The repo can build a MacOS Example and an iOS Example