Learn to code with Swift Playgrounds

Swift Playgrounds is a revolutionary app for iPad and Mac that helps you learn to code and build apps using Swift, the same powerful language used to create world-class apps for the App Store. Engaging lessons and walkthroughs demonstrate the core concepts of coding and building apps as you write real Swift code in an interactive environment.

Mac and iPad using Swift Playground’s interactive code lessons.

Learn and explore

In Swift Playgrounds, a single line of code can make amazing things happen. You’ll start with small programs called “playgrounds” to learn the basics. Interactive lessons teach key coding concepts, and additional challenges encourage you to explore code in exciting new ways. When you’re ready, you can start coding with SwiftUI, a modern, powerful framework for making great-looking apps. The results of your code appear instantly as you type, making learning to code even easier. And when you’re done, it’s easy to share your creations with friends, or even submit your app to App Store Connect.

iPad using Swift Playgrounds.

Coding concepts

Swift Playgrounds includes interactive lessons that use puzzles and experimentation to teach the following core coding concepts, and more:

Commands
Loops
Operators
Functions
Conditional statements
Parameters
Types
Variables
Initialization

Real Swift. Real frameworks.

The Swift programming language was designed to be approachable enough to be your very first programming language. Swift is also incredibly powerful, used by professional developers to create over half a million apps on the App Store. Using Swift Playgrounds, you’ll be coding within minutes. Even as you become more proficient, you’ll never outgrow Swift.

iPad using Swift Playgrounds.
iPad using Swift Playgrounds.

With Swift Playgrounds you build apps using SwiftUI, the powerful, modern user interface framework used by developers worldwide to power their app experiences. SwiftUI makes it easy to quickly create elegant app experiences and express your ideas. You can also access key frameworks, such as SpriteKit, Bluetooth, and Metal. Your code can interact directly with the iPad or Mac on which it runs. For instance, on iPad your playgrounds respond to touch gestures and interact with hardware, such as the accelerometer, gyroscope, and camera.

With support for Swift Packages, Swift Playgrounds makes it easier than ever to code your creations. Packages are bundles of reusable code that can be created by you or other developers and included in your projects. With the power of packages, you can quickly write code which formats data, queries databases, communicates over a network, and so much more.

Experiment with code

Sometimes the best way to learn is to explore on your own, and Swift Playgrounds is a great place to let your imagination run wild. In addition to the guided Get Started with Code lessons, Swift Playgrounds includes many challenges so you can keep coming back to try something new. Some challenges encourage you to play with code to create interesting effects, while others include engrossing puzzles that require all of your coding skills to solve.

Additional starting points included in Swift Playgrounds help you create playgrounds from scratch. With access to thousands of APIs in the iOS and macOS SDKs, you can create amazing playgrounds that explore the web, generate 3D worlds, experiment with physics, and much more.

Swift Playgrounds includes the App Gallery to demonstrate common app concepts such as tabbed navigation and downloading data. Guided walkthroughs show you interesting and relevant areas of code and help you learn about the powerful SDKs involved. You can also create your own apps with multiple Swift files, along with image and audio assets, and leverage the ecosystem of thousands of existing Swift packages. Send your app projects to friends and collaborate to bring your creations to life.

Built for touch

Swift Playgrounds offers tools to make coding easier and reduce mistakes. On iPad, you can take advantage of touch to create entire programs with only a few taps on the screen. Swift Playgrounds helps you write correct code by identifying mistakes as you type and offering suggestions to help correct the errors.

Share across devices

Swift Playgrounds for Mac is built with Mac Catalyst, giving you the ability to edit the exact same code on iPad and Mac. iCloud Drive seamlessly shares your files, and the changes you make on either iPad or Mac immediately appear on your other devices. It’s easy to start a project on iPad and open the file on Mac to keep coding. You can also open app projects in Xcode on Mac for a more advanced editing experience.

Mac and iPad using Swift Playground’s sharing code across devices.