Swift Playground is an app by Apple that teaches you Swift, a coding language, with which you can create iOS and Mac apps, programme robots and drones, and make music. It helps you learn to code and lets you explore the world of coding by undertaking various challenges and creating new stuff. It’s in the same league as MIT’s Scratch, but it requires students to work with actual codes, unlike using code blocks in Scratch (which is great, too). Swift, the coding language, was developed to make learning to code easy and intuitive for kids.
Learn to code
In Swift Playgrounds, learners are taught the basics of Swift coding through step-by-step ‘Fundamentals of Swift’ lessons. It requires no prior coding knowledge. The lessons and corresponding practice puzzles are set in a fun 3D environment.
- There are animations explaining codes before you get to solve puzzles using those codes
- You can choose one of the three given 3D characters to solve the puzzles with
- The code fundamentals covered in this section are commands, functions, loops, parameters, conditional code, variables, operators, types, initialisation, and bug fixing
The interface is very easy to interact with. You just need to tap, drag, or type text and numbers to code 3D characters and solve puzzles. Swift language is powerful, and is being used by professionals to create various apps.
- The snippets library in the App has codes that can be dragged into the coding area for ease-of-use
- Numbers or colours can be edited with the bumper keypad that is triggered when a number or a colour in a code is tapped
- You can touch and drag the boundaries of a loop or a conditional statement around a code
- The QuickType pad makes AI-powered code suggestions that can be tapped to select a code instead of typing the whole code in the keyboard.
- If you get stuck at a code, just touch and hold it, and you’ll get various explanations
- You can run through your code and see you code snippets highlighted as your code is run
Practice and Explore coding with Swift Challenges and Templates
Once you know the basics, you can practice and explore them through various interactive challenges. Swift Playground’s library of challenges is growing with time.
You can explore advanced coding with various Swift Playgrounds developed by Apple and other leading developers. You can explore and even subscribe to challenges from various external developers and publishers.
You can also create your own playgrounds. There are templates available the app that use iPad’s features, like Multi-touch, accelerometer, and camera, that help you create advanced codes. You can personalise your creation by adding graphics, images, audio, etc.
You can share you creations or collaborate with others by sharing your code via Airdrop, mail, and messages, and the receiver can open it in Swift Playgrounds to explore or work on it. You can also record your app when its running, with your voice narration.
Programme Robots and Drones
Next comes the most interesting part—Apple has partnered with various hardware producers who create robots and drones that are connected to Swift Playgrounds. This mean, once you know Swift, you’ll be ready to code a variety of robots and drones that are compatible with the app.
The Accessories section has various Playgrounds that let you connect to and programme various educational technology robots, drones and toys like:
- LEGO Mindstorms EV3
- Sphero – Spider-Man, Ultimate Lightning Mcqueen, SPRK, Battle-worn BB-8 Droid
- Dash by Wonder Workshop
- Parrot drones – Disco, Swing, Bebop 2 FPV
- DJI drones – Spark, Phantom, Mavic Pro, Inspire, Zenmuse X4S
- Skoog musical instrument
- UBTECH Jimu Robots – MeeBot, TanBot
- Anki’s Cozmo
- Osmo Game kits
Bluetooth APIs are used to write codes to programme these robots and drones.
Coding professionally with Swift
With Swift you can develop anything from a simple to a comprehensive app. You can export and import codes between Swift playgrounds (on iPad) and Xcode (on Mac). Xcode is used to develop iOS and Mac apps. With this ease of integration, Swift is being widely used to learn, teach and write code.
Swift Playgrounds for iPads is available in six languages—English, French, German, Japanese, Simplified Chinese and Spanish. The app is compatible with 64-bit iPads with iOS 10 or later.
If you’d like to be equipped with knowledge of a coding language that you can use to create apps, and programme drones and robots, and you have no prior knowledge of coding, then Swift Playgrounds is the place to start with.
Although the app is very thorough, there are also various Apple Education e-books that you can use through the process:
- Swift Playgrounds: Learn to Code 1&2
- Intro to App Development with Swift
- App Development with Swift