TNW València is here 🇪🇸 Pre-register for 2024

This article was published on July 14, 2016

Preview: Apple’s Swift Playgrounds is built for kids, but adults might like it too

Preview: Apple’s Swift Playgrounds is built for kids, but adults might like it too
Nate Swanner
Story by

Nate Swanner

Former Reporter, TNW

TNW's former West Coast writer in the PNW (Portland, Oregon). Nate loves amplifying developers, and codes in Swift when he's not writing. If TNW's former West Coast writer in the PNW (Portland, Oregon). Nate loves amplifying developers, and codes in Swift when he's not writing. If you need to get in touch, Twitter is your best bet.

Heading into WWDC, iOS developers from all corners of Twitter loudly proclaimed that Apple should make an Xcode app for the iPad. ‘Coding on the iPad is the next generation!’ they said. They were right — sort of.

Coding on an iPad is for the next generation of developers, and the future is here. Swift Playgrounds — now available in beta and officially launching this Fall — is an iPad app aimed at helping kids learn to code.

Those vocal developers on social media may not use it, but their kids are going to love it.

Playground’s roots

If we walk Swift Playgrounds back a bit, we find it has its roots in Xcode. Launched alongside Swift in 2014, Playgrounds was billed as a way to test code before putting it into production, or even apps.

At the time, Apple showed off a fancy game inside of Playgrounds as a means to showcase just how powerful its new service really was. Little did we know that similar gamification would soon find its way to the iPad.

Swift was equally simple and impressive. Apple’s new language was, much like Playgrounds, billed as a much simpler way to get things done programmatically. Less verbose than other languages, Swift promised a smoother transition from idea to app.

It also promised a lower threshold for those who want to learn how to make apps. In that sense, Swift Playgrounds for iPad is a bit of synergy that we all saw coming, just not as we received it.


For the kids, by the adults at Apple

Tim Triemstra, Product Marketing and Developer Tools for Apple, tells me that a “motivated 12 year old” is Apple’s concept user for Swift Playgrounds.

Still, Apple describes Swift Playgrounds as “egalitarian,” and the app itself currently has no age requirement (or suggestion) for use. It may have designed Playgrounds for a bright pre-teen, but anyone can use it.

Playgrounds won’t see kids making apps. Instead, it’s meant as a way to get them thinking programmatically in an interactive environment. The app gently corrects learners, and there is no ‘failure’ if you get something wrong; you’re just encouraged to try again, and offered suggestions on best practices.

There is also a good deal of flexibility to Playgrounds. If a child were already learning programming and wanted to jump into later lessons within the app, that’s available.

Similarly, new learners can start from absolute scratch. Apple says there will also be a second ‘Learn to code’ lesson out later this year that focusses on higher-level ideas around things you’d build an app for — like editing photos.


Schools, a natural fit

During the process of building Swift Playgrounds, Apple distributed it to educators as well as kids. It found that the app appealed to youngsters because it’s actually writing code and building on experiences.

Though Apple isn’t ready to discuss what educational avenues Swift Playgrounds may explore, its Vice President Software Engineering Operations Cheryl Thomas told me the team had educators “cross-reference” Apple’s views on how to build the app for its target audience.

There are also supplementary educational materials for Swift Playgrounds, which makes it “highly leverage-able” for schools, says Thomas.

In-app lessons were also built with educators in mind. Triemstra says lessons offer “20 to 40 hours” of interaction when done solo, and can scale to roughly 40 or 50 hours when supplemented with teacher’s guides.

The idea there was to make it easy for educators to implement. A week’s worth of full-time work may not sound like much, but Apple envisions teachers spending time discussing what’s being learned in a classroom environment in addition to the app.

Screen Shot 2016-07-13 at 3.55.36 PM

Swift’s curious position in Playgrounds

Swift Playgrounds carries the ‘Swift’ name and iconography, and it was written entirely in Swift. It also uses Swift code snippets and the language’s syntax and structure — but it’s not about Swift.

Apple is exceedingly clear that Swift Playgrounds is not about turning kids into iOS, macOS, tvOs or watchOS developers. Apple’s Director of Tools & Technologies Product Marketing Wiley Hodges tells me that kids can take what they’ve learned “wherever they want,” as the lessons it’s producing are about concepts and ideas, not tying kids into its own developer environment. Hodges continued that Swift Playgrounds is “not about learning apps for platforms. It’s about learning good coding practices.”

In use, that’s pretty clear. Playgrounds offers no ‘marketing’ for Swift, and never mentions that you’re using Swift. It’s Swift code, sure — but helping new coders learn was always a core tenet of Swift anyway.

And by the time someone encounters the differences Swift has from other languages, the programmatic thinking they may have learned in Swift Playgrounds is simply boilerplate logic. Something like transitioning to a dynamic typed language from Swift’s static types has nothing to do with Playgrounds, really.

The app

Note: Swift Playgrounds is in beta at the time this article is written.

The base lesson for Swift Playgrounds is ‘Learn to Code,’ a robust plan that walks a learner from step one (literally; the first thing you do is move a character forward) all the way though more complex concepts like creating default functions for each time a character encounters a particular situation and manipulating the environment itself.

Screen Shot 2016-07-13 at 3.56.37 PM

It also has a specially designed keyboard for those times when you have to manually enter code, which lets you float between letters and symbols used in code rather than asking you to find them via the stock keyboard. Accessing the symbols is different, too: dragging down on a letter puts things like curly braces or parentheses into your code.

Playgrounds is also reliant on preset snippets of code and drag-and-drop. Creating an if-else loop snippet, for instance, requires that you add ‘if’ to the code from the code drawer at the bottom of the screen, then click on it to add ‘else’ or ‘else if.’ If you need to extend the parameters of the statement, you simply drag and drop to let it encompass more code.

Challenges are the stepping stones to success in each lesson, which lends itself to the overall gamification of the ‘Learn to Code’ lesson. There’s never a time when you’re not doing and learning.

Once you think you’ve got the solution handled, tapping ‘Run My code’ puts what you’ve done into action on-screen. If you fail, your hero (Byte, because computers) hangs its head. There is even a ‘Hint’ button that eventually gives up the solution if you’re just plain stumped.

The future

Apple is getting the ball rolling with Playgrounds on iPad, and tells me it has no plans to stop producing lessons that help kids learn about programming.

Screen Shot 2016-07-13 at 4.13.46 PM

But others are free to take it where they see fit. You can create your own playgrounds, and those Playgrounds can be shared using the stock share-sheet within the app. A teacher could create a custom lesson, then distribute it to the entire class via iTunes U, too.

Once Xcode 8 is more stable, expect developers to create Playgrounds for iOS with Swift 3 there as well. Sharing from iPad to Xcode is also possible, but there are features that may not be available.

Playground files can also be downloaded from the Web, or any other means that seem appropriate — like GitHub. Apple isn’t making Playgrounds for iPad directly monetizable, but it’s easy to imagine enterprising souls selling lesson plans as Playground files via the Web for eager learners.

Meant for kids, it’s approachable for adults, too. Learning to code can be hard, and Swift Playgrounds does an excellent job of making learning fun without being too child-like. It’s also a good reason to have an iPad (and I tested it back to the iPad mini 2, so it’s not very picky about which hardware you have).

Interestingly, there’s no apparent glass ceiling for Swift Playgrounds on iPad. The parameters Apple has in place are technological, not philosophical. It uses Swift for obvious reasons (Apple created this program, and Swift is its new default language — and again, great for learning code), but there’s a strong sense that it’s not about Swift at all.

It’s about the kids.

Get the TNW newsletter

Get the most important tech news in your inbox each week.

Also tagged with