Coding in the Classroom with Swift Playgrounds

swift playgrounds(1).png

The recent release of iOS 10 unlocked a creative coding opportunity for iPad classrooms called Swift Playgrounds. It’s an iPad app that lets you solve interactive puzzles that are designed to help you learn the basics of how to code in a programming language called Swift. It is aimed at students aged 12 and over and is part of Apple’s Everyone Can Code initiative. So, if you are looking for new ways to start coding with students, this could be a great new platform for you to explore. Here’s what you need to know.

What is Swift?

Swift is an open source programming language that was developed by Apple engineers and released in 2014. It was created to help developers build apps for iOS, macOS, watchOS and tvOS. Swift has its origins firmly rooted in another programming language called Objective-C, but Swift is generally considered to be more concise. The app, Swift Playgrounds, was developed to help introduce a younger audience to the finer points of programming with Swift, and to help foster a new generation of programmers for Apple devices.

Getting Started With Swift Playgrounds

Swift Playgrounds is only available for iPads running iOS 10 or later. You also need at least an iPad Air, or an iPad Mini 2, because these are the oldest devices that are capable of running the app. The iPad 2, the iPad 3, the iPad 4 and the original iPad Mini are not compatible Swift Playgrounds because they either can’t be upgraded past iOS 9 or lack the hardware necessary to run the Playgrounds app.

Once you launch the app you will see lessons at the top of the screen and coding challenges underneath. If your students have never programmed with Swift before, the lessons are the best place to start because they introduce you to the basics that students will need in order to attempt the challenges.

Each lesson has text on the left-hand side of the screen that introduces a task. This text introduces commands that the students will use to complete the puzzle. The tasks ask you to move a cartoon character (called Byte) around a virtual world which is depicted on the right-hand side of the screen. This virtual world can be manipulated with touch to rotate or zoom in on specific areas to get a better idea of what you need to do.

playgrounds intro.gif

One nice thing about Swift Playgrounds is that you rarely, if ever, need the iPad keyboard. Commands are suggested at the bottom of the screen and you simply tap them to select them. You can also choose coding blocks from a drop-down menu and drag code around to rearrange. It is all very touch-centric, which is how it should be for iPad users.

Beyond the Basics

Once you have explored the tutorials, you will likely want to dive in to the challenges. Apple has said they will update these regularly so that there is always a good selection to choose from. Presently there are four, (all dated September 2016), but more are likely to arrive in future app updates. The challenges are labelled with a skill level like Beginner, or Intermediate, to help give you an idea of how much time or knowledge will be required to complete the task.

However, you can also build your own playgrounds from scratch. This allows the greatest level of creativity because you start with a blank slate (or a template) and use whatever code and media is available to you in order to create something new.

Ready to share your code with the world? You can with Mail, Messages or AirDrop. Projects can also be submitted as assignments in iTunesU. If you want, you can record a video of yourself writing the code, or running your code, complete with an audio narration (although I couldn’t get the narration to work on my iPad for some unknown reason). Creating coding videos like this could be a useful teaching tool for educators who want to make their own coding challenges complete with an introductory video for students.

iOS Screenshot 20160914-172920.png

Final Thoughts

Swift Playgrounds is obviously not the only coding app for the iPad. In fact, there are dozens of apps like this in the App Store, and many have been around for some years now. You can see some here. However, Apple’s take on a coding app for kids is certainly an innovative and intriguing approach.

That said, it might be worth letting your students know that there is only so much you can do in the app, (hence the Playgrounds moniker). Although you are coding in Swift, you can’t create an app exclusively in Swift Playgrounds. This is more of a tutorial experience, or a sandbox if you will. Those who are serious about publishing their code can export it to Xcode on a Mac and polish it up for release in the App Store.

Additional Resources

In order to help people get to grips even further with learning Swift as a programming language, Apple has also put together a couple of iBook guides, which you can access below. These are free resources that are available for anyone to download and use.

Swift Playgrounds: Learn to Code 1 & 2 – This Teacher Guide is designed to help you bring Swift Playgrounds into the classroom, no matter what your level of experience with coding is. It includes activities, reflection questions, journal prompts, and more to help you bring coding into any classroom.

App Development With Swift – This course is designed to help you build a solid foundation in programming fundamentals using Swift as the language. You’ll get practical experience with the tools, techniques, and concepts needed to build a basic iOS app from scratch. You’ll also learn user interface design principles, which are fundamental to programming and making great apps. Prior programming experience is not required for this course.

13 thoughts on “Coding in the Classroom with Swift Playgrounds”

  1. I love the new teacher resources and the iTunes U course for Swift Playgrounds. The reading is a little heavy for lower elementary but with some help I think my grades 3-4 students can handle this. My only complaint about Swift Playgrounds is that the code doesn’t light up or highlight when it runs. This would make it much easier to find bugs. Thanks for the taking the time to give us a great overview of the app.

    1. Agreed. The whole app is a little text heavy the more time you spend in it, which is probably why Apple have been touting it as a 12+ app. However, if you look at apps like The Foos, you see you can still do a lot with much less text.

  2. Great use of the iPad. One of the first times I’ve seen something designed for the iPad and said to myself, “I’d like to check that out.”

  3. I have been programming for 3.5 years, and I think it would be pretty challenging for students and adults who are absolute beginners to learn the new Apple dev curriculum. Learning to write real code takes a fair amount of time, patience and perseverance. So, I’m not sure how teachers without programming experience will be able to independently teach their students the entire curriculum. I think teachers will need guidance from experienced programmers via consultations, tutorials, and/or guest lessons. To begin offering support, I created videos ( demonstrating solutions for the middle school curriculum, and tweeted ( solutions for the high school curriculum. I hope it helps.

  4. We have been using the Learn to Code curriculum in the Swift Playgrounds app for a couple years now with great success. Our students have grasped the ideas of looping, conditional code, abstraction and compositing very well for the most part. However, we have found that we get everyone progressing through the curriculum, more robustly, without losing students if they have regular feedback on their coding activities. We created a set of video discussions and sample solutions related to each Learn to Code activity, that the students use to compare to their solutions: We use these videos to inspire classroom discussions about optimum ways to solve each of the problems.

  5. Wow, that is really awesome! Our children have a great opportunity to study in such an interesting time, with all these new technologies.. I can cite this info in my Systems Analysis and Design project, thank you!

Leave a Reply