We looked at a couple of great examples from the previous section, and we couldn't help but think. How they are designed, how to turn from a blank canvas into a complete, beautiful animation. How these animations are generated and what properties have been changed. What we have to think about is what happens at each step.
Most of the time, we all just manipulate positions, transparency, and scaling to create great animations.
XY coordinate properties (Position)
If we want to move the position of an object on the screen, we only need to change the position property. In the iOS coordinate system, the origin (0.0) is in the upper-left corner. For example, to make an animation that rises from the bottom, just set its y-coordinate at the beginning of the animation to be greater than the resolution of the screen, and then set its y-coordinate in the center of the screen at the end of the animation.
Transparency Properties Opacity
The transparency of an object may be the most common animation, such as fading. The frequency of use is high because of the high degree of convergence with the background when changing. We typically use transparency with animations of other properties. For example, objects rise from the bottom to the center of the screen, with transparency from 0 to 1.
Scaling Properties (Scale)
By adjusting the Zoom property, you can animate the focus of the crowd. For example, we can create a warning box that changes the scale property from 1.3 to 1.0, and then with the transparency change from 0 to 1.
In addition to position, transparency, and scaling, there are three commonly used animation properties: color, angle (rotation), 3D property. We often change the background from one color to another in iOS. Change a button from 0 degrees to 180 degrees, then back to 0 degrees. And 3D flipping is a useful and common animation.
Swift Animation Programming Guide -02 How Swift animation is tempered