Learn how to structure your Flow file and create clean timelines that you can import easily into an iOS project.
If you completed the previous tutorial, you should already have a design file to work with. Otherwise…
In our Sketch file there are 6 artboards, 4 of which we’ll use for animations and one of the other two we will use for helping us with layout.
Let’s start with the checkbox.
The check box has 3 layers:
Let’s get to it.
checkBoxAnimatable.sketch
checkBox
for the t0
positioncheckBoxEnd
for the t1
positioncheckBoxForward
Hit Play
It’s actually not too bad out of the box… but we can make it better.
We first saw how to use the stroke end
property in the CodePen and Dribbble tutorials.
t0
checkMark
layerstroke end
to 00.25s
Ease Out
For the inner and outer boxes we will change their duraton and easing.
checkBoxInner
track to 0.25s
> this will move all its child keyvalues.checkBoxInner
track to 0.75s
checkBoxInner
animationsEase In
checkBoxOuter
track to 0.5s
checkBoxOuter
animationsEase Out
Finally, this animation is way too long. UI animations should be relatively fast – iOS defaults to 0.25s – so let’s shorten the duration of the timeline.
0.5s
scale
buttonHere is what your timeline should look like:
Hit Play
We’ve created the forward animation, now let’s create the reverse (which will get triggered when a user un-checks a button).
checkBoxForward
title, select Duplicate
checkBoxReverse
checkBoxReverse
title, select Reverse
Hit Play
This step is pretty easy… we’ve already created our assets so that they animate the way we want. We’ll only need to tweak the duration and easing to get a nice effect.
+
button, or pressing ⬆︎⌘N
background
for the t0
positionbackground
for the t1
positionbackgroundForward
Let’s tighten up the animation.
path
track > sometimes this gets added, but we don’t really need it.x
, width
and height
Ease In
opacity
track to 0.75s
Ease Out
0.5s
Here is what your timeline should look like:
Same as above, but now for the background…
backgroundForward
title, select Duplicate
backgroundReverse
backgroundReverse
title, select Reverse
It’s handy to have a non-animating timeline that you can reference for layout q’s etc.
end
for the t0
AND t1
positionsLayout
Done.
You can export this to an xcode project to reference the layout, fonts, etc.
So, now you have a Flow file with 5 timelines in it. This is perfect for handing off to a developer. In the next tutorial we will integrate the 4 main timelines into the standard iOS UIButton
.
Here is a quick vid of all the steps above.
❤︎