Customize Your Input Devices

Swift Playgrounds 4.0: First Look

Source: Apple.

Source: Apple.

Yesterday, Apple released Swift Playgrounds 4.0, the first version of the app from which you can build an app and publish it on the App Store. That’s a big step forward for the app that started as a limited sandbox for learning to code. The app is not as capable as Xcode. Still, with support for Swift 5.5, live previewing of the app you’re building as you code, multiwindowing, access to SwiftUI, UIKit, the ability to move projects between Swift Playgrounds and Xcode, and more, the app has an enormous amount of potential waiting to be tapped.

Apple's coding course selection has grown steadily since 2016.

Apple’s coding course selection has grown steadily since 2016.

Swift Playgrounds has steadily improved since its introduction in 2016 on the iPad and launch on the Mac last year. Early versions of the app were firmly grounded in learning to code. That’s still the case. The app includes an extensive catalog of lessons on how to code and build apps. There’s also a new ‘Get Started with Apps’ lesson and an App Gallery section that includes several sample apps to help teach coding basics.

Starting a coding project from Playgrounds isn’t new either. However, now, you can take that project, submit it to the App Store and sell it once the app clears the App Review process – all from an iPad. That’s a very big deal because it’s the first time an app can be created end-to-end on the same device that runs it. Swift Playgrounds can be used to create apps with iOS and iPadOS 15.2 that run on iPhones, iPads, and M1 Macs, but you cannot create Apple Watch apps or Mac apps that aren’t built for iOS or iPadOS.

Creating my first Swift Playgrounds project.

Creating my first Swift Playgrounds project.

The update to version 4.0 requires iPadOS 15.2. Once installed, the most recent version of the Swift programming language and Apple’s SwiftUI framework for building app UIs are both available. As you work on an app, you can monitor a live preview that changes as you work on your code. That preview can be taken full-screen too. The editor has code-completion suggestions, project-based search, keyboard support, a snippets library of SwiftUI interface elements, and Swift Package support that allows for integrating third-party code into projects. Projects can also be moved back and forth between Swift Playgrounds and Xcode.

The update is a big step forward, but there are still limitations compared to building an app with Xcode on a Mac. Steve Troughton-Smith has been tweeting his first impressions of Swift Playgrounds, and although I think it’s fair to say he’s been impressed overall, he’s also run into some notable limitations like the lack of access to In-App Purchases if you build an app on the iPad.

Swift Playgrounds’ limitations aren’t surprising. Creating a usable development environment on an iPad is a significant challenge. I haven’t tried building anything myself yet, but from what I’ve seen, Swift Playgrounds 4.0 is a huge step forward that I expect Apple will continue to refine and expand if the app’s last five years of development are any indication.

Unlock MacStories Extras

Club MacStories offers exclusive access to extra MacStories content, delivered every week; it’s also a way to support us directly.

Club MacStories will help you discover the best apps for your devices and get the most out of your iPhone, iPad, and Mac. It’ll also give you access to advanced iOS shortcuts, tips and tricks, and lots more.

Starting at $5/month, with an annual option available.

Join the Club.

A Club MacStories membership includes:

  • MacStories Weekly newsletter, delivered every week on Friday with app collections, tips, iOS workflows, and more;
  • MacStories Unplugged podcast, published monthly with discussions on what we’re working on and more;
  • Monthly Log newsletter, delivered once every month with behind-the-scenes stories, app notes, personal journals, and more;
  • Access to occasional giveaways, discounts, and free downloads.