From the course: Learning iOS Animations with UIKit

Unlock the full course today

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

Chapter solution

Chapter solution - iOS Tutorial

From the course: Learning iOS Animations with UIKit

Start my 1-month free trial

Chapter solution

- [Instructor] Alright, so in keeping with our structure, let's go down underneath animateGraphicIn, and start declaring a new function. We're going to say func animateLoadingLabelPulse. It's going to take no parameters. Inside we're just going to call UIView.animate. And we want to choose the first option because it has duration, delay, options, and a completion handler. So for the duration, I want it to last about half a second. Delay is going to be zero, I want it to fire immediately. Now the options, this is where this is super important. We want this to repeat and to auto reverse. So it's pulsing in and out on an infinite loop. Now for the animations, I'm going to tab and enter to auto complete that. Tab into completion and set it to nil. Now if you're wondering about the naming conventions of these functions, it's generally good practice to name your animations with a direction or the effect they're going to produce. So for instance, we have animate title label in because it's…

Contents