I animate the presentation between two points using the UIViewAnimationCurveLinear, so I know the speed of this animation. In some cases, I want to add a UIViewAnimationCurveEaseOut to make the view slow to a stop. To make this effect unexcited, the relief animation should start at the same speed as the previous linear animation. Given the fixed distance at which I want this attenuation to occur, how can I calculate the duration needed to reach this known initial speed?
For example, let's say I animate my view from x = 0 to x = 100 in 10 seconds. Thus, the speed is 10 pixels per second. Now I want the view to slow down from x = 100 to x = 120 using the UIViewAnimationCurveEaseOut animation. How long is this animation to start at 10 pixels per second?
I understand that Core Animation CAMediaTimingFunction controls the movement of the animation using cubic Bezier curves, where the second and third control points determine the shape of the curve. I believe the UIViewAnimationCurve attenuation functions are also cubic Bezier curves. If I knew the default control points used by these functions, I could develop a formula for calculating the duration of a given speed and distance, but I could not find these default control points, somewhere documented.
source share