Swift Playgrounds
Code classes come to the Mac
Free From Apple, apple.com/swift/playgrounds
Needs macOS 10.15.3 or later
It’s taken four years, but Swift Playgrounds has finally made it to the Mac courtesy of Catalyst, Apple’s initiative for bringing iPad apps to macOS. Designed for coding beginners, Swift Playgrounds feels more like a video game than a coding app as it gently teaches you the basic concepts of programming via Apple’s own Swift language, currently in version 5.1.
Swift is used to create apps for Macs, iOS, Apple Watch and Apple TV, but Swift Playgrounds isn’t an app development kit. Think of it as a brightly colored, user– friendly classroom where you’ll learn the concepts you’ll go on to use in Xcode.
To begin, Apple gives you a collection of introductory modules that introduce you to the basic concepts of coding. These modules, the Playgrounds of the app title, get you to control a cute character called Byte using commands such as moveForward( ), turnLeft(), and collectGem( ): Get it right and Byte completes the challenge so you can move on to the next one. It’s an excellent way to learn and there’s a real sense of achievement when you get Byte to complete a task. Additional challenges involve interacting with shapes and creating games. In addition to Apple’s own Playgrounds, there are Playgrounds from other publishers that enable you to control external devices: Current third–party offerings include Playgrounds for Lego Mindstorms, Tello drone programming, and Adafruit robots.
Apple hasn’t just ported the entire app across to the Mac. It’s also added some Mac– specific features including Touch Bar support, the ability to drag and drop code snippets into your project, click and drag code wrapping for loops, and conditional statements. There are also code suggestions to speed up the time it takes to put it all together. And because it’s on the Mac, it can import, export, and cut and paste between Xcode and Swift Playgrounds on the same device. The only thing that the Mac version can’t do that the iPad version can is to use ARKit augmented reality documents, which require the live, motion–sensitive camera view of an iPad.
Swift Playgrounds is to Xcode what GarageBand is to Logic Pro: A simpler, friendlier place to experiment and learn before moving up to the pro–level product.
THE BOTTOM LINE. Swift Playgrounds is an excellent educator for new coders.