Friendly Introduction iOS Animations

Laurie Gray
Jul 26, 2017 · 2 min read
Mohawk Duck likes animations too

Today we’re going to go over basic animations in iOS. Animations are a great way to add a nice feeling of customisation and interactivity in your apps and there are lots of things we can do with them. In this lesson, we’ll cover some of the basics so you can get started.


Animations follow a simple pattern: From -> To with a duration. What do I mean? Well we declare what we want the view, or whatever we’re animating to go from and then we animate to.

Let’s take an example. Let’s say we want an image to animate in some way within our app. I won’t cover changing the sizes or constraints here, but I’ll introduce you to the animate API.

UIView.animate(withDuration: 1.0, animations: {})

Here we have access to a static method called UIview.animate(withDuration). What’s a static method? It is a method that exists on the UIView class that we can access very conventionally by simply writing UIView. The most basic implementation comes with a duration and an animations closure.

Whenever you write animations inside the closure these will be executed over 1.0 seconds. You can lengthen and shorten these values to suit your needs.

I hope this super short introduction to animations gets you interested in the animate API with iOS. Stay tuned for more!

Laurie Gray

Written by

iOS Developer, raywenderlich.com iOS Video Instructor Team Member & Udemy Instructor — Also known as a ‘Total Learn-o-holic’.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade