From the course: Advanced iOS App Development: Core Animation

Unlock the full course today

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

Understanding the presentation layer

Understanding the presentation layer - iOS Tutorial

From the course: Advanced iOS App Development: Core Animation

Start my 1-month free trial

Understanding the presentation layer

- [Instructor] Now that we've got some animation code under our belts, it's important that we talk about what's actually happening when a layer animation plays. Let's take the title label as an example. Go up to view will appear and underneath the sign in button round method, let's just change the title label's alpha to zero. So we'll say titleLabel.alpha = 0.0. And let's run this and see what happens. Alright so that's funny, our animation plays and then our title label's alpha is back at zero. So this is happening because when an animation starts the object or view we're animating is actually replaced or overlaid by a cached copy of itself which is called the presentation layer. The presentation layer is what's actually animating and it's removed when the animation finishes. Again showing the original real view as it appeared before the animation. Now if it helps you can think of the presentation layer as an imposter layer; it makes more sense. So let's run our app one more time and…

Contents