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 - iOS Tutorial
From the course: Advanced iOS App Development: Core Animation
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Simple layer animation4m 20s
-
(Locked)
Reusing animations4m 30s
-
(Locked)
Using fill modes1m 52s
-
(Locked)
Working with springs, part 13m 52s
-
(Locked)
Working with springs, part 24m 1s
-
(Locked)
Understanding the presentation layer3m 37s
-
(Locked)
Keys and delegates, part 16m 58s
-
(Locked)
Keys and delegates, part 26m 11s
-
(Locked)
Easing and looping animations4m 17s
-
(Locked)
Chapter challenge1m 33s
-
(Locked)
Solution2m 7s
-
-
-
-
-
-