In this blitz of a doc, we're going to show you how to integrate a Lottie animation, exported from Flow, into an iOS project.
If you don’t have an iOS project you’re already working on, then create one now. If you’ve already got a project, skip to the next section.
This step starts at 0:32
Flow exports some buttery Lottie animations. So, let’s install their cocoapod.
This step starts at 0:57
New Podfile from Xcode Project
pod 'lottie-ios', '~> 3.1'
Now, let’s output some Lottie…
This step starts at 1:44
FlowLogoAnimationtimeline using the
At this point you could have a look at your animation, running via Lottie, by opening the index.html file you just exported
Let’s get our animation into our project.
This step starts at 2:22
flowlogoanimation.min.jsoninto your Xcode project
Next, you need to add a view to your app. We’re using storyboards. If you’re using SwiftUI, or another approach, just adapt the next few steps to your needs.
This step starts at 02:39
Viewto your storyboard.
345 x 240
Now, let’s connect everything up.
This step starts at 3:43
viewDidLoadinstantiate the animation like this:
let animation = Animation.named("flowlogoanimation.min") animationView.animation = animation
viewDidAppeartrigger the animation like this:
To make an animation repeat, add a variable to the constructor.
This step starts at 5:14
loopModeto the animation view so that it looks like this:
animationView.loopMode = .repeat(.greatestFiniteMagnitude)
result(s) found for “”.