Answer the question
In order to leave comments, you need to log in
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.
Answer the question
In order to leave comments, you need to log in
Usually subclasses UITabBarItem
and UITabBarController
. Redefine the necessary sv-va and methods. First of all, redefine the property selectedItems
on your subclass and selection methods on click, adding layer
animation to them.
As for the animation, I would path
fill 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 questionAsk a Question
731 491 924 answers to any question