Swift Playgrounds for iPad


Note this article is based on a Beta version, the features may change before final release in the Fall of 2016. Swift Playgrounds for iPad was announced at WWDC16. Swift Playgrounds is an interesting new application for the iPad, built from the ground up to work with coding via a touch interface.

I think a lot of developers were hoping to see a version of Xcode for iPad, this seems to be the next best thing for now. Anyone that has used an online course system like CodeSchool will immediately feel at home learning this way. At first watching the keynote I was a little disappointed as the application was sold as being aimed at younger users with an almost game like interface. However that has changed since watching the WWDC session video dedicated to the app. It is indeed a power house of a Swift tool. I can see this as being embraced by teachers for anyone of any skill level. Documents created in the application are compatible with Xcode 8 and can be shared using AirDrop, iCloud Drive, or other document providers to share between devices.

They do contain code and comments specific for the application but this does not cause a compatibility issue in Xcode. There is a new document format called ‘Playground Books’ that in many ways remind me of an extended version of iBooks. The books format is a package that you can edit and add any content to that you might need to reference in any of the playgrounds you create. Books are made up of pages that group together unsurprisingly into chapters. No need to worry about an index of content, that gets created automatically for you based on the structure.

Several different views allow you to view and edit code, read documentation and see a live view of code in action. Apple clearly thought about taking advantage of the touch interface by creating a custom keyboard and syntax completion bar, all of this allows you to create code in just a few simple touches. Or alternatively code from the ground up like you do now using conventional Swift Playgrounds in Xcode.

Why Educators Should Create for Swift Playgrounds

The Swift Playgrounds application is the perfect tool for teaching at any level, you can create books with a new page type that enables you to create cut scenes in a full screen view, enabling the ability to demonstrate code or concepts without interaction from the user. There is the ability to create a glossary linked to by any content in your screens along with configurable code completion in the new bar. I could see the syntax bar being a great benefit when trying to communicate abilities in a custom library you may of built for example, providing a user with end time API access. Other key features include

  • Editable regions that the learner can fill in without touching existing code, perfect for building on a theme over time.

    • You can have hidden code blocks to do things like set-up that a user never sees.
    • You can have an Always-On live view on the right side of the application.
    • You can analyze what has been typed and provide hints or track progress over time.
    • You can provide an assessment for each page that is remembered, great for testing and a results page.
    • There is a key/value store that gets saved with the book.
    • A user can reset your page back to the beginning if needed to start over.
    • Designed to be used with touch controls

The Wrap

After a some what simplistic sales introduction during the WWDC16 keynote, it turns out that Swift Playgrounds on iPad has an awful lot to offer for users of any experience level. It also provides a great platform for anyone looking to teach Swift in an interactive and easily updatable way, this maybe a glimpse in to Apple’s ideas for the next level of iBooks? When released in the Fall of 2016, I can see this being a popular way to distribute courses over conventional books and videos. A perfect next step would be some kind of real-time connection back to a Mac or Apple TV to extend to a great audience, think classroom interaction.