A
A
Aleksandr Govorukhin2018-05-24 11:25:06
iOS
Aleksandr Govorukhin, 2018-05-24 11:25:06

How to make animation in Swift 4?

Hello!
How are these animations created? Where can I read about animations, there are a lot of creative ideas in my head, but I don’t understand how to implement them at all, I’m not even familiar with animation, I’ll be glad for some guides and so on.
gif1.gif

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
doublench21, 2018-05-24
@SnapSh0t

Usually subclasses UITabBarItemand UITabBarController. Redefine the necessary sv-va and methods. First of all, redefine the property selectedItemson your subclass and selection methods on click, adding layeranimation to them.
As for the animation, I would pathfill it with color .clear. The path is a circle and a line going from it. Moreover, if the element is the most extreme, then the current line is on the left or right, for the rest it is in both directions. It remains to add only strokeEndAnimation, which will fill this path with color going from the beginning of the path to the end. This is well written here: https://www.calayer.com/core-animation/2017/12/25/...
And you need to define the fill for all possible cases. That is, the paths will actually intersect but will not be one single path. Let's say the animation of the transition from the first to the last will paint over only a straight line for all intermediate ones. Well, and so on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question