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.
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.
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.
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.