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.sketchcheckBox for the t0 positioncheckBoxEnd for the t1 positioncheckBoxForwardHit 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.
t0checkMark layerstroke end to 00.25sEase OutFor 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.75scheckBoxInner animationsEase IncheckBoxOuter track to 0.5scheckBoxOuter animationsEase OutFinally, 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.5sscale 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 DuplicatecheckBoxReversecheckBoxReverse title, select ReverseHit 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 ⬆︎⌘Nbackground for the t0 positionbackground for the t1 positionbackgroundForwardLet’s tighten up the animation.
path track > sometimes this gets added, but we don’t really need it.x, width and heightEase Inopacity track to 0.75sEase Out0.5sHere is what your timeline should look like:
Same as above, but now for the background…
backgroundForward title, select DuplicatebackgroundReversebackgroundReverse title, select ReverseIt’s handy to have a non-animating timeline that you can reference for layout q’s etc.
end for the t0 AND t1 positionsLayoutDone.
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.
❤︎
result(s) found for “”.