From the course: Advanced iOS App Development: Core Animation

Unlock the full course today

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

Creating action objects

Creating action objects - iOS Tutorial

From the course: Advanced iOS App Development: Core Animation

Start my 1-month free trial

Creating action objects

- [Instructor] Now that we've gotten our hands dirty with several different kinds of animations, we're at the point where we can start talking about the actions that back animation behavior and how to create them. Now, essentially core animation uses actions to drive behaviors. Actions can be used to create almost any effect or behavior that you'd wanna perform on a layer as long as they adopt the CA action protocol. What we'll be doing in this example is refactoring the grading animation on the dashboard view controller into a custom CA action which will run from the CA layer delegate protocol. Now, if this sounds confusing, don't worry. We'll go through it step by step. Now, the first thing we wanna do is select our Utilities folder, right click, select new file, and this is just gonna be a Swift file, and we're gonna name it Actions. Now, for our first action, we need to declare it as a new class. So we'll call this gradient color action, and it's gonna be of type NS object, and…

Contents