Swift Playgrounds
![Swift Playgrounds](https://photos5.appleinsider.com/gallery/product_pages/130-hero.jpg?=1694860710)
Apple's development environment, Swift Playgrounds, aims at teaching novice coders to comfortably be able to write in Swift, Apple's custom coding language. Available on both the iPad and macOS, the app is designed to quickly offer programmers feedback without the hassle of constant recompiling after tweaks, and inspires experimentation through its approachable interface.
● Immediate feedback without need to recompile
● Simple lessons teach basics of coding
● Kid-friendly interface makes learning code easy
● Additional lessons available through third-party subscriptions
● Available for both iPadOS and macOS
● Publish apps to the App Store using iPadOS 15
Page last updated:
Get Apple News Directly in Your Inbox
Swift Playgrounds is a development environment for Swift that was released to macOS within Xcode on June 2, 2014, and later ported to iPad on September 13, 2016. The Mac Catalyst version of the app was launched on Mac in February 2020.
The goal of the app is to help users learn to code Swift, Apple's general-purpose, compiled programing language. By learning Swift, users will be able to code apps and programs for iOS, iPadOS, macOS, watchOS, tvOS, and Linux.
The app can also be used to quickly prototype both program functions, as well as user interface and user experience elements. Toy manufacturers quickly took advantage of Apple's robust app experience and have launched devices that let you turn playtime into learning to code.
In 2021, Apple announced a critical update to Swift Playgrounds on iPad — the ability to publish apps to the App Store directly from an iPad. Apps built on iPad can only be written using the Swift language, and users can only publish iPhone and iPad apps to the App Store.
Swift Playgrounds Features
Publishing
Users need iPadOS 15 and Swift Playgrounds to develop apps on their iPad. Completed projects can be uploaded to App Store Connect directly from Swift Playgrounds.
Since the app is built around teaching novice coders, it has features like code suggestion autocomplete and a library of icons for use during development. Developers can see their app update in a live preview window and even run the app to test its features within the development environment.
Projects built in Playgrounds are also universally compatible with Xcode, so users can move their project to Xcode and back as needed.
Environment
The app allows novice coders to test and render code in real-time. It can evaluate and display the results of a single expression as it is coded, giving immediate feedback to the coder.
This can decrease development time for experienced users, allowing them to maintain a constant workflow without needing to resolve themselves to an arduous and inefficient trial-and-error process.
Typically, this kind of development environment is referred to as read-eval-print-loop, or REPL, and is lauded for its ability to encourage experimentation and learning. It also is particularly beneficial when it comes to quickly prototyping code with instant feedback.
Platforms
The app is available both on iPadOS and bundled with Xcode for macOS. Originally introduced and bundled with Xcode 6, Apple designed the macOS version of Playgrounds to give developers a place to quickly code and receive immediate feedback without needing to recompile every time the developer tweaks the code.
Another upside is that it gave developers a quick way to test out user interface elements without needing to build the entire program first.
When it came to the iPad, it was touted as both a development environment as well as an educational tool. The app allows users to download lessons and challenges which can be accessed offline at a later date.
The iPad version comes bundled with a few lessons that teach young or inexperienced coders the basics of coding syntax. Coders will assist three characters, Byte, Blu, and Hopper, in achieving simple goals such as navigating to goals or collecting gems.
These goals can be completed by filling in code and debugging scripts, teaching coders the basic syntax of coding.
Topics
The app starts out teaching novice coders about code syntax, simple commands, functions, loops, parameters, conditional coding, variables, operators, types, initialization, and how to fix bugs in code.
After mastering the fundamentals of Swift, users can download additional topics via "More Playgrounds" within the iPad. This allows users to use Playgrounds to learn more advanced topics, including ARKit, MapKit, camera access, and the ability to work with third-party accessories.
Third-party Accessories
For young coders, several third-party companies have created products to use alongside the iPadOS app.
One such third-party device is Lego's Mindstorms EV3 kit, a programmable brick that features three motors, a touch sensor, a color sensor, an infrared sensor, and a remote control. The kit also includes snap-on parts enabling users to build a variety of robots.
Another is Sphero, a company that creates a series of robots and toys that are capable of being controlled both through Swift Playgrounds and Sphero's apps. Their Star Wars-branded toys are fun to play with but also a coding playground for teaching concepts surrounding logic paths and routines.
Swift Playgrounds Audience
Apple suggests students aged eight or older should be able to use the app for the iPad and encourages schools and teachers to incorporate their Everyone Can Code curriculum into the classroom.
Thanks to a large library of additional lessons that can be purchased from a subscription, even veteran coders can learn additional skills by downloading third-party lessons.
Currently, Swift Playgrounds is available in English, Dutch, French, German, Italian, Japanese, Korean, Portuguese, Simplified Chinese, Spanish, Swedish, Thai, Traditional Chinese, and Turkish.