Group Group Group Group Group Group Group Group Group

Errata Version 4.0

Chapter 2:

“initialSpringVelocity: This controls the initial velocity of the animation. A value of 1.0 sets the velocity of the animation to cover the total distance of the animation in the span of one second. Bigger and smaller values will cause the animation to have more or less velocity.

Excerpt From: “iOS Animations by Tutorials.” iBooks.

The bigger the value, the slower the animation will be, and the smaller, the faster it will occur. Hence a smaller value has a higher velocity. It sounds like the reverse in the text. In other words, if the velocity is set to 0.5, now the distance must be covered in half the time (a half second) therefore it would need to have a higher velocity to achieve that, and vice versa.

@abunur Thanks very much for bringing this to our attention. The value appears to represent time, which means the velocity will increase if given less time, and decrease if given more time. So velocity is inversely proportional to time. In physics: v = d/t, which means then that t = d/v. You are correct, and you have physics to support your point :slight_smile:

Thanks once again for bringing this to our attention!

All the best!

1 Like

:thinking: maybe we should reword this to be clearer, thanks Fuad

1 Like

I agree the wording is not clear but what @abunur is saying isn’t quite right. The animation finishes in the duration time regardless of the initial velocity (it’s part of why UIView spring animations are kind of sucky), so all the initial velocity parameter affects is how fast the animation appears at the start. It’s for handing off from gestures. But with a 1 second duration, the animation always takes one second. I’ve tested it.

… and the example given in the docs suggests lower values = lower velocity as well:

For example, if the total animation distance is 200 points and you want the start of the animation to match a view velocity of 100 pt/s, use a value of 0.5 .

0.5 = 100 pt/s, 1.0 = 200 pt/s