THIS WEEK'S SPONSOR:

Kolide

The fleet visibility solution for Mac, Windows, and Linux that can help you securely scale your business


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 More with Club MacStories

Founded in 2015, Club MacStories has delivered exclusive content every week for over six years.

In that time, members have enjoyed nearly 400 weekly and monthly newsletters packed with more of your favorite MacStories writing as well as Club-only podcasts, eBooks, discounts on apps, icons, and services. Join today, and you’ll get everything new that we publish every week, plus access to our entire archive of back issues and downloadable perks.

The Club expanded in 2021 with Club MacStories+ and Club Premier. Club MacStories+ members enjoy even more exclusive stories, a vibrant Discord community, a rotating roster of app discounts, and more. And, with Club Premier, you get everything we offer at every Club level plus an extended, ad-free version of our podcast AppStories that is delivered early each week in high-bitrate audio.

Choose the Club plan that’s right for you:

  • Club MacStories: Weekly and monthly newsletters via email and the web that are brimming with app collections, tips, automation workflows, longform writing, a Club-only podcast, periodic giveaways, and more;
  • Club MacStories+: Everything that Club MacStories offers, plus exclusive content like Federico’s Automation Academy and John’s Macintosh Desktop Experience, a powerful web app for searching and exploring over 6 years of content and creating custom RSS feeds of Club content, an active Discord community, and a rotating collection of discounts, and more;
  • Club Premier: Everything in from our other plans and AppStories+, an extended version of our flagship podcast that’s delivered early, ad-free, and in high-bitrate audio.