In this blitz of a doc, we're going to show you how to integrate a Flow animation into an iOS project using our Cocoapod. It's dead-easy... watch this.
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:19
Flow exports solid Swift code. But, it needs a few lightweight extensions to properly integrate with UIKit. So, let’s install our cocoapod.
This step starts at 0:49
New Podfile from Xcode Project
pod 'FlowCommoniOS', '~> 1.8.4'
Now, let’s output an iOS export…
This step starts at 1:47
FlowLogoAnimationtimeline using the
Next, you need to drag a few files into your project.
This step starts at 2:21
FlowLogoAnimationTimelineinto your project
import FlowCommoniOSto both of those files
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 3:10
Viewto your storyboard.
345 x 240
Did the animation appear in Interface Builder?! Flow’s views are
Now, let’s connect everything up.
This step starts at 4:44
var timeline: Timeline!
viewDidLoadinstantiate the timeline like this:
timeline = FlowLogoAnimationTimeline(view: sceneView, duration: 3.5)
viewDidAppeartrigger the animation like this:
To make an animation repeat, add a variable to the constructor.
This step starts at 6:14
repeatCountto the timeline constructor so that it looks like this:
timeline = FlowLogoAnimationTimeline(view: sceneView, duration: 3.5, repeatCount: .greatestFiniteMagnitude)
result(s) found for “”.