Swift Playgrounds: Previewing Apple's remarkable new portal to code

What's new with Swift Playgrounds?

March 2018: Apple announces AR support for Swift Playground!

Apple announced that AR support (using ARKit) is coming to Swift Playgrounds! Not only will kids be able to see 3D models of Byte (the character that the code manipulates) but they will also be able to use the iPad camera to showcase Byte's virtual world within the real world.

ARKit for Swift Playground: Everything we know so far

March 2017: Apple has just made Swift Playgrounds available in 5 additional languages

Apple's Popular App for Learning to Code in Swift Now Supports Simplified Chinese, Japanese, French, German and Latin American Spanish."The Swift Playgrounds app has helped people of all ages learn the basics of coding, and with more than a million downloads to date, customers and students find it an easy and fun way to get started with Swift," said Tim Cook, Apple's CEO. "Hundreds of thousands of iPhone and iPad apps, including some of the most popular in the App Store, use Swift — a programming language we designed to be both powerful and easy for anyone to learn."

Swift Playgrounds for iPad — although the words "one more thing" weren't said out loud before its introduction at WWDC 2016, that's exactly the importance it was given. And deservedly so.

Tim Cook, Apple's CEO, announced it, and Cheryl Thomas, vice president of software engineering operations, showed it off: A technical marvel with a coding environment, made multitouch, directly manipulable, and fully accessible, melded with an educational miracle, teaching coding itself in a way that's engaging, empowering, and approachable to everyone.

It's not just the mainstreaming of technology — something Apple has proven themselves good at a ridiculous amount of times over the last few decades — but the mainstreaming of the tools used to drive the technology itself.

I had a chance to preview Swift Playgrounds on iPad, to attend the WWDC sessions and talk to developers at the labs. I also spoke with Cheryl Thomas; Tim Triemstra, who manages product marketing for developer tools; and Wiley Hodges, director of product marketing for tools and technologies.

Thanks to all of that, I now get to share some early thoughts on Swift Playgrounds with you. And, frankly, to gush. A lot.

BASIC, Logo, Hypercard, the web — in the early days of personal computing, it felt like everyone was learning to code and discovering something new and exciting all the time. But those days faded and, for a decade or so, there wasn't a great way for beginners, especially kids, to get into code.

Swift Playgrounds featured tab.

Apple's new programming language, Swift, was deliberately crafted to fix that. It was crafted to fix other things as well, of course, but from the moment it hit the stage at WWDC 2014, it was immediately — spectacularly — obvious just how empowering it could be for education and for everyone.

And a large part of that was "Playgrounds".

Playgrounds isn't an entirely new concept, but it's radically new at mainstream scale. Playgrounds provides a live view of what your code is doing, up to, and including, animation and interactive 3D models.

On the Mac, it lives inside Xcode, Apple's traditional programming environment. This fall, along with iOS 10, it's coming to the iPad App Store as well.

It's not just as a developer environment either. Apple is also providing a ridiculously well-considered, ongoing educational environment to go along with it.

And that was the plan from the beginning, according to Thomas.

If a smile hasn't already burst across your face, consider: Soon, anyone with an iPad, even if they've never thought about programming before, will be able to very literally fingerpaint with code, and, more importantly, learn how to make art.

That's apparent from the moment you launch the Swift Playgrounds app. The first screen you land on is the Featured tab. It looks just like the App Store, showcasing both lessons and challenges you can download and get started on.

The second tab is My Playgrounds, which stores the lessons you've already downloaded, as well as custom projects you've built all on your own. It looks like Keynote or Pages, with templates to help bridge the gap between lessons and full-on flying solo.

All of that was intentional according to Triemstra. The team wanted Swift Playgrounds to be immediately familiar and instantly approachable to as many people as possible. Since pretty much everyone already knows how to use the App Store, and many know how to use the iWork apps, there's no barrier to using Swift Playgrounds. You dive right in.

Also, because you can edit and rename anything in My Playgrounds, you can make even a single iPad multi-user. Each child can have a copy of a Playground named just for them, with their own progress and at their own pace.

The tools inside Playgrounds are fiercely cool as well. There are QuickType predictive suggestions for code, so what you want is often exactly what you'll see. Developers can even control what's available for suggestion, so they can optimize for their Playgrounds.

There's a new keyboard that makes entering a number or symbol as easy as tapping and swiping it up. You can edit in place with context-sensitive popup menus and attribute pickers, so you can easily add options for values, complete statements, and even choose colors. You can also drag and drop code elements, which is incredibly intuitive behavior on iPad.

Swift Playgrounds works in Split View with other iPad apps, of course, but it also works as a split view, giving you a Swift coding window on the left and a Playgrounds window on the right. Using the same touch-and-hold mechanics as Split View, the operating system-level feature, you can drag the code or Playground window full screen.

In a delightfully clever departure from how the main Split View feature works, if you rotate to portrait, you don't get two skinny windows. You get two full-width windows with Playgrounds stacked on top of Swift coding.

Sharing == Caring

Sharing is profoundly human. Sometimes an experience doesn't feel real until we share it. It's why we have partners and families and teams and offices and classes. It's especially important for learning, where insight doesn't just come from the lessons we learn but from the lessons learned and shared by those around us. It would take an eternity, after all, to discover everything all on our own.

Swift Playgrounds lessons.

With Swift Playgrounds, you can share anything in My Playgrounds with anyone you like over email, iMessage, or AirDrop. That's great for sending your latest awesome creation to a sibling across the room, or your quick prototype to your fellow engineer across the country.

Since Swift Playground lessons take the form of "books," you can also create and share your own lessons, customized for your own kids, classroom, course, team, or the world at large.

Hodges explained the sharing is absolutely safe. Though Swift Playgrounds provides the full power of the iOS SDK, it's also fully sandboxed, and there are a few things that are off limits. That way, for example, no one can use Playgrounds as a way to try and steal any contacts or personal information, or to try and get any malware onto anyone's system.

In a world where privacy and security are continually devalued, it's great that Apple is not only alleviating even the potential for concern from anyone who still understands the critical importance of both, but protecting those who don't even think about it at all anymore.

There's another, even more exciting way to share Swift Playgrounds: ReplayKit. That's Apple's screen recording technology introduced last year for games. With it, you could record what you were playing and send it to your friends. Coming this fall, ReplayKit will let you stream what you're playing live to popular video platforms, and your Swift Playground sessions, too.

Anyone who's seen a child watch Minecraft videos while playing Minecraft, or sit endlessly in front of a Twitch or YouTube stream knows how powerfully engaging it can be.

Imagining that power and engagement for code? Chills.

/* Inclusivity */

Accessibility was baked into Swift Playgrounds from the start, according to Thomas. Part of making coding open to everyone is making coding open to everyone. That naturally extended to diversity as well, according to Triemstra.

Swift Playgrounds for iPad.

When you start the first lesson you meet a character named Byte. Apple could have used something akin to a scrappy, mustached plumber or optional bright, pink-hatted princess, but those would reflect only a tiny sliver of the user base. Apple could have also defaulted to a simple geometric shape labeled "Object 1," but that would have been bland and uninspired. So, like with Siri, Apple went with personality, and they took it a step further.

Byte looks like a golden pear with a sea blue eye, yellow front pack, wide mouth, tiny legs, and floppy noodle arms. That's something any child, any person, can relate to regardless of who they are or what their background is. With a tap, though, pear-Byte leaps up to an island in the sky where you can choose from two other versions — a similarly cyclopean raindrop with a messenger bag, and a green, two-eyed, hammer-headed backpacker in what looks like a button-down cummerbund.

That leaves you free to identify with any of the Bytes, any way you like. That was an especially important design goal, according to Triemstra. There's little point in making a technically approachable environment if, the minute someone uses it, they can't see themselves reflected in it.

This way, Byte can be anything you want, including you. And when you add the code, Byte can do anything you want as well.

It makes the experience less like work and more like play. I found myself cheering when Byte collected the gem, flipped the switch, and went through the portal. Even finding and fixing bugs was like beating a level in a game, motivating me to keep trying, and to continue on to the next level — er, lesson — as soon as I finished the last.

And only occasionally, with incredible joy, would I realize it was me — me! — writing code.

//#-The-A-Team

Hodges made it clear in our conversation that Swift Playgrounds for iPad is the full, real Swift. It's not Swift Jr. or Swift Lite, or any extract or dilution. It's the full power of the iOS SDK at your fingertips.

Swift Playgrounds template.

The lessons and challenges, which, according to Thomas, were prepared alongside educational experts both inside and outside of Apple, and field tested by kids of all ages, are an ongoing effort. More of both are on the way, and will be updated and added to for a long time to come.

So there's no need to worry that Swift Playgrounds will be delivered with a lot of excitement but will eventually be abandoned as Apple turns its attention elsewhere. Like privacy, education is core to Apple's culture.

That extends to the team, Triemstra said. Swift Playgrounds wasn't farmed out. It wasn't a secondary or tertiary project. It was built by Apple's own, internal engineers. The ones that have built some of the most important features we use on a daily basis.

Rumor has it, in fact, that the teams behind Swift Playground included serious talent. Code and education matter to a lot of people at Apple, not just at the executive level but at every level. They went to Apple to dent universes, and things like Swift Playgrounds are top-of-the-list for many of the very best designers and engineers.

There's an optimism — almost a nobility of purpose — that radiates from the entire project. And it shows in every part of the app, from concept to design, content to coding, execution to delivery. It sings. It dances. It makes you giddy with potential.

It's the full stack.

End.bottomLine()

I have so much more to say about Swift Playgrounds for iPad that I'm going to stop now, or I fear I'll gush forever. No app has ever had me more excited or more hopeful for the future.

The potential seems limitless, which is something that came up in my conversation with Cheryl Thomas, and that's beyond exciting.

Needless to say, I'll be expanding on this preview and writing a lot more in the months to come.

For now, if you're interested in an early look and you have an extra iPad to spare, you can download the iOS 10 public beta — here's some help if you need it — and have at it. Playgrounds is built right in. Otherwise, Swift Playgrounds will be available separately, for free, on the App Store this fall following the final release of iOS 10.

It's one of the finest things Apple has ever done, and it's going to change the way coding is done for the next generation.

Rene Ritchie
Contributor

Rene Ritchie is one of the most respected Apple analysts in the business, reaching a combined audience of over 40 million readers a month. His YouTube channel, Vector, has over 90 thousand subscribers and 14 million views and his podcasts, including Debug, have been downloaded over 20 million times. He also regularly co-hosts MacBreak Weekly for the TWiT network and co-hosted CES Live! and Talk Mobile. Based in Montreal, Rene is a former director of product marketing, web developer, and graphic designer. He's authored several books and appeared on numerous television and radio segments to discuss Apple and the technology industry. When not working, he likes to cook, grapple, and spend time with his friends and family.