Swift Playgrounds
There’s a real sense of achievement when you complete a task
Free FROM Apple, apple.com/swift/playgrounds NEEDS macOS 10.15.3 or later
Though it’s taken four years, 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 coloured, 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. It’s an excellent way to learn and there’s a real sense of achievement when you complete a task. Additional challenges involve interacting with shapes and creating games. There are also 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.
Specifics and suggestions
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. CARRIE MARSHALL