Day 58
Day 58 ๊ด๋ จ
Project 15, part two
I hope you can agree that animation in iOS is almost invisible โ we just lay out all the changes we want to happen, and Core Animation figures out all the intermediate steps to make it happen.
As Iโve said several times, animation is more than about making our software look good โ it has a functional purpose too, ensuring that users understand why things and changing and what states they are moving from and to.
Larry Niven once said, โthat's the thing about people who think they hate computers โ what they really hate is lousy programmers.โ Folks paid a lot of money for their iPhones and iPads, and Appleโs software oozes polish and refinement โ if you donโt put a similar level of care into your own code then your app will stick out, and not in a good way.
So, with todayโs challenges you need to apply your new animation knowledge to the projects youโve made previously. I think youโll be pleased how easy it is, and I hope also inspired to take on more animations in the future!
Today you should work through the wrap up chapter for project 15, complete its review, then work through all three of its challenges.
Wrap up
Wrap up
Core Animation is an extraordinary toolkit, and UIKit wraps it in a simple and flexible set of methods. And because it's so simple to use, you really have no excuse for not using it.
In this project you learned about the animate(withDuration:)
method of UIView
, spring animations, as well as alpha values and CGAffineTransform
.
Remember, animation isnโt just there to make our apps look pretty โ it also helps guide the users eyes. So, if you're moving something around conceptually (e.g., moving an email to a folder, showing a palette of paint brushes, rolling a dice, etc) then move it around visually too. Your users will thank you for it!
Review what you learned
Anyone can sit through a tutorial, but it takes actual work to remember what was taught. Itโs my job to make sure you take as much from these tutorials as possible, so Iโve prepared a short review to help you check your learning.
Click here to review what you learned in project 15.
Challenge
One of the best ways to learn is to write your own code as often as possible, so here are three ways you should try your new knowledge to make sure you fully understand whatโs going on:
- Go back to project 8 and make the letter group buttons fade out when they are tapped. We were using the
isHidden
property, but you'll need to switch toalpha
becauseisHidden
is either true or false, it has no animatable values between. - Go back to project 13 and make the image view fade in when a new picture is chosen. To make this work, set the
alpha
to 0 first. - Go back to project 2 and make the flags scale down with a little bounce when pressed.
Wrap up - Additional
Thatโs another project finished, and one that sets you up to use animation at will in the future โ post some videos online to show folks your creations!