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.

Solution

Solution - iOS Tutorial

From the course: Advanced iOS App Development: Core Animation

Start my 1-month free trial

Solution

(soothing music) - [Instructor] Alright, I'm gonna jump right in, and underneath animate button with spring, gonna make myself some new room, create a new function, called animate button click. Inside, I'm going to say let pop equals C.A. spring animation, key path, animation helper dot scale. Now, I don't want the button effect to be overpowering, but at the same time, I want it to be noticeable, so I'm gonna set the from value to one point two, which will be an increase of 20%. For the two value, I just want it to pop back to which original scale of one. Remember that it's easiest to use the from value as the change you wanna see in your animation, and the two value as your final destination, which works out really well here. For the duration, I'm gonna say, pop duration equals pop dot settle in duration. Now let's set the spring specific properties. I want the initial velocity to be a little bit more than its default, so I'm gonna say it's gonna be two. I want it to be slightly…

Contents