From the course: Advanced iOS App Development: Core Animation

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Keys and delegates, part 1

Keys and delegates, part 1 - iOS Tutorial

From the course: Advanced iOS App Development: Core Animation

Start my 1-month free trial

Keys and delegates, part 1

- [Instructor] An important part of dealing with any animation is the ability to store information about it that we can access later. Now lucky for us the CA Animation class is completely key value coding compliant, which means that our basic and spring animations are as well. For our first example we're gonna update our code to only fire the sign in button animation once the password field finishes its fade in. So the first thing we need to do is go into our fadeInViews method and set our first key value pair. So we're gonna say fade.setValue, and for this method we can store any value for a string key. So the value we're gonna use password and forKey we're gonna say animation_name. An important thing to note here with keys is that they take effect in the same way that the modified properties do just like we saw with reusing animations. If this code was put before the animation was added to the title label, say, all three fade in animations would share the same key value info. Which…

Contents