Kodeco Forums

Video Tutorial: Intermediate iOS Animations Part 3: Animation Timing

In this video, learn how to add easing and delay to your layer animations.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/3270-intermediate-ios-animation/lessons/4

Hi Marin,

Enjoying this series, looking forward to more.

At around 3 minutes with adding the speed, to me it looks like changing the duration would do exactly the same. E.g. change the duration to 1.0 (from 0.5) is the same as changing the speed to 0.5 ( from a default of 1.0). Have I missed something that makes it necessary to use speed to achieve.

You can change both speed and duration - those really are different ways to achieve the same thing :slight_smile:

Hi Marin,

I copied the same code, but Iā€™m getting an error in the delay part

delay(seconds: 5, completion: {
self.loginButton.layer.backgroundColor = startColor.CGColor

        tint.fromValue = tintColor.CGColor
        tint.toValue = startColor.CGColor
        self.loginButton.layer.addAnimation(tint, forKey: nil)
    })