A book on creating delightful iOS animations in Swift 4. From beginning to advanced topics like layer animations, view controller transitions, and more.
This book is for iOS developers who already know the basics of iOS and Swift 4, and want to dive deep into animations.
Start with basic view animations and move all the way to layer animations, animating constraints, view controller transitions, and more!
These five chapters will introduce you to the animation API of UIKit. This API is specifically designed to help you animate your views with ease while avoiding the complexity of Core Animation, which runs the animations under the hood. Though simple to use, the UIKit animation API provides you with lots of flexibility and power to handle most, if not all, of your animation requirements.
You’ll learn how to move, scale and fade views. You’ll create a number of different animations to get comfortable with Swift and the basic UIKit APIs.
You’ll build on the concepts of linear animation and create more eye-catching effects using spring-driven animations. Boiiing!
You’ll learn about several class methods in UIKit that help you animate views in or out of the screen. These one-line API calls make transition effects easy to achieve.
This chapter teaches you how to combine techniques you’ve already learned in creative ways to build up even cooler animations.
You’ll use keyframe animations to unlock the ultimate achievement of an impressive UI: creating elaborate animation sequences built from a number of distinct stages.
Auto Layout has been around for a while now – it was first introduced in iOS 6 and has gone through a series of successful iterations with each release of iOS and Xcode. The core idea behind Auto Layout is incredibly simple: it lets you define the layout of the UI elements of your app based on relationships you create between each of the elements in the layout. Although you may have used Auto Layout for static layouts, you’ll go beyond that in this section and work with constraints in code to animate them!
This is a crash course on Auto Layout in case you’re not familiar with it already; you’ll need this for the next chapter.
Once you’ve worked through the project in Chapter 6, you’ll add a number of animations to it and put your newfound knowledge to good use.
Now that you are proficient in creating view animations, it’s time to dig a bit more deeply and look into the Core Animation APIs on a lower, more powerful level. In this section of the book, you’ll learn about animating layers instead of views and how to make use of special layers.
You’ll start with the simplest layer animations, but also learn about debugging animations gone wrong.
Here you gain more control over the currently running animations and use delegate methods to react to animation events.
In this chapter you combine a number of simple animations and run them together as a group.
Take a tour of the shiny new CASpringAnimation class in iOS 9, which allows you to easily create layer spring animations.
Here you’ll learn about layer keyframe animations, which are powerful and slightly different than view keyframe animations.
Draw shapes on the screen via CAShapeLayer and animate its special path property.
Learn how to use CAGradientLayer to help you draw and animate gradients.
Here you will draw shapes interactively and work with some powerful features of keyframe animations.
Learn about the little known but powerful CAReplicatorLayer class.
By now you know how to create a wide range of beautiful animations for your apps. You’ve experimented with moving, scaling and fading views, animating different types of layers – and a whole lot more. It’s time to learn how to use these animation techniques in the broader context of app navigation and layout. You’ve animated multiple views and layers already, but now take a bigger-picture perspective and think about animating entire view controllers!
Learn how to present view controllers via custom animated transitions.
You’ll build upon your skills with presenting view controllers and develop a really neat reveal transition for a navigation controller app.
Learn how to make the reveal transition interactive: the user will be able to scrub back and forth through the animated transition!
UIViewPropertyAnimator is a class introduced in iOS10, which helps developers create interactive, interruptible view animations. When you run animations via an animator, you have the possibility to adjust those animations on the fly - you can pause, stop, reverse, and alter the speed of animations that are already running. In this section of the book, you are going to work on a project featuring plenty of different view animations, which you are going to implement by using UIViewPropertyAnimator.
Learn how to create basic view animations and keyframe animations. You’ll look into using custom timing that goes beyond the built-in easing curves.
In this chapter you are going to learn about using animators with Auto Layout. Further, you will learn how to reverse animations or make additive animations for smoother changes along the way.
Learn how to drive your animations interactively based on the user’s input. For extra fun you’ll look into both basic and keyframe animations interactivity.
Create custom View Controller transitions using a UIViewPropertyAnimator to drive the transition animations. You will create both static and interactive transitions.
This section of the book will show you how to position and rotate layers in 3D space. You’ll work with a special property of CATransform3D: namely, the transformation class applied to layers. CATransform3D is similar to CGAffineTransform, but in addition to letting you scale, skew and translate in the x and y directions, it also brings in the third dimension: z. The z-axis runs straight out of the device screen towards your eyes.
Learn how to set up your layers in 3D space, how to choose the distance from the camera to your layer, and how to create animations in your 3D scene.
Go further into 3D space and learn about some of the more advanced ways to create 3D Animations.
In the first four sections of this book, you learned about the core APIs and classes behind iOS animations. There are two more specialized topics, particle emitters and frame animations, that don’t fit in with any the previous sections, so you get a bit of a breather from keyframes and 3D animations!
Learn how to use UIKit’s built-in particle emitters to create a fun snowfall effect.
Learn how to sequence multiple images together into a flipbook-style animation.
Very useful from a practical point of view. After reading a few chapters you are ready to be an animation rock star. Seriously worth reading.Jon M.
This book has become my single authoritative source for iOS animations. Marin introduces the rich complexities of the technology and distills it down into easily digestible layers.Jefferson W.
ands down the best book to start learning animations for the iOS platform. Clear, concise writing with a lot of diagrams to help the reader follow along.Sagar N