Animating with Springs

Before iOS 7, you'd perform many interface animations with something like the following:

[UIView animateWithDuration:0.3f
    animations:^{
        //animations here
    }];

Now, though, you've got something far more powerful - springs:

[UIView animateWithDuration:0.3f
    delay:0.f
    usingSpringWithDamping:0.7f
    initialSpringVelocity:20.f
    options:0
    animations:^{
        //animations here
    } completion:nil];

Springs make the interface feel alive - they allow for an animation to carry a sense of momentum with it. Most of the animations in iOS 7 use this method, and while it's a bit of a trick to find the right damping and velocity values, it's really easy to find 'em if you're using Tweaks.

Damping can range from 0 to 1 - it's like the "brakes" on the animation. A value of 0 will let the animation oscillate on its spring. A value of 1 will bring the animation to rest without oscillation.

Velocity is the initial speed of the animation - how hard the animation is "flicked" at the start. I'm still really fuzzy on what the right value is to use here, but again - hook this up to Tweaks and you'll find it in no time.

There's a wonderful talk from WWDC 2014, Session 236 "Building Interruptible and Responsive Interactions" that talks a lot about handing off between animation blocks, and choosing the right values for your damping and velocity values.