New Toys! Animating Images

I had a great question from a teacher at a secondary school here in Ireland about animating images in a Swift Playground. The question was basically: How do I do it in a playground with Swift?

You can go to the source, of course, and check out the documentation, but I’ve added a new playground to our new Adventures feed to show off two ways (sort of) to display an animated image.

Our Adventures feed, for those of you just joining us, or who’ve forgotten, is aimed at slightly more advanced folks. It explores things like SwiftUI, UIKit in playgrounds, and more.

The PlaygroundBook: Animating Images

The new playground book is called Animating Images and shows you how to use some of the cool capabilities in UIImageView to display a series of images over a certain amount of time.

The first page is an implementation of animated images using UIImage and UIImageView. We pass an array of images to a static method on UIImage and set the duration over which they should be displayed. Play around with different numbers of images and duration to fine tune your animation. Make sure to read through the comments, which will show you other ways of using UIImageView.

The second page implements the same thing, but with SwiftUI. It cheats, a little bit. The Image view that you would use to display images in SwiftUI doesn’t animate UIImages that are animations. Try it out, instead of using our new AnimatedImage view, comment that line out and add this line:

        Image(uiImage: self.animatedImage)

You’ll see a very static image that only displays our first image from the array. Our AnimatedImage addition is simply a wrapper around UIKit’s UIImageView. We could have used Combine or some other clever way to update our view with images. But this approach simply takes advantage of a well-known component we can re-use without too much pain.

Try it out, play around with your own images, your own timing, and see what kind of animated image you can create!

You can subscribe to our Adventures feed (or the original feed) here from your iPad. Alternatively, if you use Playgrounds on a Mac, you can paste this URL into the subscription bar:

Quick Start to Coding at Home

We held some live coding sessions during EU Code Week 2020. They included unplugged activities, away from the iPad, and then a follow-along session of coding in various Swift Playgrounds.

Now, these sessions were a ton of fun in the classroom, but if you find yourself schooling at home again, like we are in Ireland, these sessions are great breaks from the regular school day. (Not to toot our own horn or anything!)

A bit of structure

There are ten sessions in the Quick Start to Code with Swift and we have ten pages that explain each day.

We have a short explanation of the day’s lesson, followed by an embedded video of that day’s recording. After the video we have an explanation (including what materials you need) for the unplugged session. The next section give you ideas about how to extend the lesson, if you found it really easy, or really enjoyed the coding. And the final section has code samples to help you solve that day’s puzzles. There’s even a handy copy link to copy the code and paste it into your Swift Playground, if you’re browsing the web pages on your iPad.

At Home

So if you’re a teacher, or a parent, or a student, the site will guide you through Apple’s excellent Quick Start to Code with Swift.

It’s not ideal, to be remote learning again, when I know our secondary school kids were loving being back in the classroom and back in some semblance of normality. But hopefully our EU Code Week content will keep you going and help change the pace a bit.

Maybe try jumping on a Zoom or WebEx call with your friends and work on your dance moves in the unplugged segments. Or arrange to all try the puzzles from a particular day. Sometimes it helps to talk through and work on the code for a shared problem.

What Comes Next

We have some ideas about where you can go next, once you’ve completed the quick start.

And we’ll be back, very soon, here, to guide you through some more coding. So have those iPads ready, brush up on your Swift, if you want, and we’ll see you again, really soon!

EU Code Week: “How To” Session

As I’ve mentioned, we’ve got a big EU Code Week special coming up really soon.

And I’ve also mentioned that it’s not just for schools.

So if you happen to fall into one of these two categories: You’re in a School or You’re Not in a School; then have I got something for you!

“How-To” Session

On Tuesday, October 6th we’ll (myself and Dr. Steve Bunce, my co-host for the EU Code Week special) be hosting a special “How-To” session.

We’ll run through what the sessions are all about, how they’ll be structured, and then how best you can follow-along with the session from the comfort of your own home or the classroom.


This session is for everyone, not just teachers. Not just parents. If you have an iPad and you want to give this coding lark a try, we’d love to have you!

It’ll be a chance to find out what we’ll be doing, ask some questions, and even offer input, if you like.

So sign up for the how-to session and get ready for EU Code Week!


EU Code Week: Not Just for Schools

Our sessions for EU Code Week aren’t just for classrooms! Just in case you were looking at all the materials, like the Using this Site in Class page, and thinking it was aimed at schools only, I added a new page: Using this Site at Home.

It’s a bit like our Coding at Home series: the video session will be designed for you to follow along, no matter the setting. If you can view the video on a big screen while you code along on a separate iPad that would be amazing, but if you only have one device at home, you just make due with what you have.
All this stuff, the site, the videos, the links, they’re all designed just to give you a bit of support to explore coding on your iPad.

Code Week, European or Otherwise

Wherever you are, you’re more than welcome to catch our sessions. Heck, we’ve got an American living in Ireland co-presenting with someone from the UK.

So if you want to follow along and try to embrace coding during EU Code Week, feel free to register your event, even if it’s your own household! We’ve got some instructions for doing so here.

So grab your iPad, sit back, relax, and get ready for some coding!

Welcome Back to School!

For many of you, you’re arriving back at school over these last few weeks (or days, even).

Hopefully your coding journey won’t end with the return to school. After all, you can apply coding to a lot of your schoolwork.

While we’ve been working on some cool stuff for teaching coding in the classroom — virtual or otherwise — you can still try your hand at our Coding at Home series.

Learning to Code

As we’ve seen with all of our playgrounds, coding isn’t always about coding for coding’s sake.

Sometimes we’re trying to explore our creative side with photos or sound. Other times we’re creating our own brand new reality. In our next session, we’ll show you our story-telling creation.

We touched on it way back in the beginning of our coding at home adventure, but only briefly.

I love telling stories, and doing so with a Swift Playground and a little bit of code is all the more fun!

We’re going to demo building a short story in which you can navigate an environment and become a part of the story, yourself. So be sure to stay tuned for our next coding session!

And, speaking of which…


Happy coding!

Video Lessons for Coding with Swift


In case you’re missing our live sessions every week day terribly, keep in mind you can still visit any one of the videos we did over the last few months at Coding at Home.

This page has links off to the various YouTube playlists, where we’ve collected our library of content for:

  • Everyone Can Code Puzzles — relive the excitement of the Everyone Can Code Puzzles book from Apple and refresh your memory on all sorts of coding techniques and tricks
  • Lights, Camera, Code — a jaunt through using your iPad’s camera
  • Build your own Aquarium App — building on the Lights, Camera, Code stuff, we strike out on our own to build our own app using some of the same techniques we learned with our camera exercises
  • Augmented Reality — one of our huge hits, try your hand at augmenting your own reality with lunar landers, pinball games, you name it! Not a lot of coding knowledge required, but you’ll have a ton of fun!
  • And so many more…

You’ll re-live all the excitement of our live sessions with all the bloopers and feed issues as we (I hope) got better and better over time.

So while we’re building the next iteration of lessons/sessions, catch up on the old!

Coding at Home: Paused

Like yesterday, we’re taking a little hiatus. In the meantime, we have a ton of back catalog to trawl through. But no live coding today.

Under construction, sort of…?

Teaching Swift

If you’re a teacher, we added a post yesterday about teaching swift.

We started up a little community Slack instance to talk about how to teach Swift, give some pointers to great teachers of the language, and other coding tips and tricks.

I’d love to have you if you’re even remotely interested.

Next steps in your coding career

If you’re hungry for more coding, you could always make the next leap. If you have a Mac, you download Xcode and have a look at my course on Ted about Getting Started with Xcode. You’ll be building an app in no time*!

Good luck!

* No time actually works out to about 40 minutes. Give or take.

Coding at Home: July 16th, Press Pause

There will be no live coding today!

Okay, okay, stop crying. Please. You’re making a scene.

It’s embarrassing. Flattering, but embarrassing.

Okay. You good?

Everything okay?

Man, you’re really getting into this coding thing.


I hope you’ve been spending the evening and on into today coding your own messages to pass around to friends and family.

Maybe send out all your messages for the day on WhatsApp and Instagram and SnapChat and whathaveyou encoded and only give out the shift key later in the day.

Nblf tvsf up tnfmm tpnf sptft, cvu gjstu nblf tvsf uif qfstpo up xipn uifz cfmpoh jt plbz xjui zpv tnfmmjoh uifn. Uifsf’t opuijoh xpstf uibo hfuujoh jo IVHF uspvcmf xifo zpv’sf kvtu uszjoh up tojgg tpnf sptft.

Bmtp nblf tvsf uif sptft bsfo’u qmbtujd, bt zpv’mm mppl sjejdvmpvt tojggjoh qmbtujd sptft, uifo uszjoh up qmbz ju dppm mjlf zpv lofx uifz xfsf qmbtujd uif xipmf ujnf. Fwfszpof lopxt.

Tp tnfmm tpnf sptft, xjui dbsf, boe xf’mm tff zpv tppo!

To decrypt this you’ll need the time we usually broadcast at (Irish time, of course), and your Cipher playground. Good luck!

In the meantime, go check out some of our playlists to review coding lessons we’ve done here: Coding at Home.

Coding at Home: July 15th, Cipher

Join us today when we approach one of my all-time favorite playgrounds, Cipher, at 1pm, Irish time!

Recap: Sensor Arcade

We said goodbye to Sensor Arcade yesterday with a bit of cheat codes.

We’ll explore the Sensor Arcade infrastructure in some future lessons. The potential of using your iPad and its myriad of sensors is so exciting, and this is a great playground to test them all out!

Now we can see practical applications for all this code we’ve been learning about.

And we’ll certainly come back to these concepts and tools in the very near future.

Today’s session

For today, though, we’re going to explore one of my absolute favorite playgrounds: Cipher!

It’s a little bit about cryptography and coded messages and a tiny bit about code. But the reason why it’s my favorite playground is because it’s structured around a story.

We’ll experience the story and learn a little about crypto.

I can’t wait to get started on it with you. See you at 1pm!

Coding at Home: July 14th, Sensor Arcade, Gem Hunter

Join us today as we finish out Sensor Arcade at 1pm, Irish time!

Bumper Bash

We covered a lot of ground yesterday. In Bumper Bash, we learned about the collision handler, which lets us know which two sprites just collided with each other. This is a huge addition to our coding toolbox!

Now if we’re writing a game we can let the SpriteKit framework do the work of figuring out when two objects have collided.

Now, my high score wasn’t amazing for this one. Have you managed to beat it?

We’ll look at a few ways to cheat the system today — we’re coders, after all, we can write our own rules!

We’ll also explore the applyForce method on our sprites and see what that does.

Gem Hunter

We also moved on to Gem Hunter yesterday. This playground page combines all the inputs we’ve learned about: touch, light, sound, and collisions. We’re going to write a game that will use a few different ways of manipulating our player to get as many gems as possible.

My high score for this game, our first pass, also wasn’t brilliant, so please tell me you were able to beat me!

We’ll spend a little time rigging up some easy win scenarios today. Then we’ll think about what might make the game even more playable.

What behavior will our player have in reaction to light updates? Will we add some labels to see values from our events in real-time?

Come code with us today at 1pm, Irish time!