Bringing the rich animations to your app with Lottie.

The super modern animation library.

Do you know very easy way to use modern animations in your app.
Lottie will make your app really modern.
A wide variety of animations and buttons.
You can use them in free.

Animation Example.

Install Lottie.

(SwiftPackageManager version. Just follow the procedure.)

Open the Xcode project.
Set Dead Code Stripping to “No” in Linking in Build Settings.

Select File> Swift Packages> Add Package Dependency.

Copy Lottie’s GitHub URL: https://github.com/airbnb/lottie-ios to the Repository.
And Next.

Click Next.

Click Finish. Now, Lottie is already in your project.

Download the animation file

Download the JSON file of the animation you want from Lottie web site.

Just choose and click “download” Sorry for Japanese.

Drag and drop JSON file in your project.

Add Animation View to your app.

Import Lottie.

import Lottie

Initialize Animation View. It can be treated as subclass of UIView.

var animationView = AnimationView()
animationView.frame = view.frame
animationView.contentMode = .scaleAspectFit view.addSubview(animationView)

Initialize the Animation and play it.

var animation = Animation.named("36596-the-woman-sitting-on-the-phone")
animationView.animation = animation
animationView.play()
The background is transparent.

Options

animationView.stop( )
animationView.pause( )
// animationView.loopMode
.playOnce (default)
.loop
.autoReverse (Repeat play and reversing)
.repeat(Float)
.repeatBackwards(Float)
// animationView.backgroundBehavior (The behavior of the animation when the app become background)
.pause
.pauseAndRestore (Auto play when the app become active)
.stop (Jump the start of the animation)
.forthFinish (Jump the finish of the animation)
animationView.play(fromProgress:) // 0~1
animationView.play(toProgress:) // 0~1

You can also make your own animations

You can learn how to make your own Lottie animations by the designers tutorial in the Lottie web page.
Or, you can edit the existing animations in The Lottie editor.
There are a lot of free or paid animations and informations (also Lottie for web) in Lottie.

🐣

****

We send information about Machine Learning, AR, iOS app.

Request for work:

rockyshikoku@gmail.com

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store