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