FEATURED APP

Learn to code with Swift Playgrounds

Anyone can make real apps – and have real fun.

Swift Playgrounds

Learn real coding the fun way

View

As accessible as it is powerful, Swift Playgrounds makes learning to code fun – no matter your age or experience. The app’s game-like lessons will quickly have you levelling up in Swift, the programming language behind more than half a million apps for iOS, iPadOS, macOS, tvOS and watchOS. And with the latest version, you can even submit apps to the App Store right from within Swift Playgrounds!

Here’s what you need to know about this versatile and intuitive learning tool.

Learn by playing

Launch the app and choose a playground (we recommend Get Started With Code). Swift Playgrounds’ split window shows a video game world inhabited by a cute one-eyed creature named Byte; on the left is the code area, where you enter Swift commands to control Byte. Your task is to get Byte to travel across the colourful terrain and collect gems, enter portals, flip switches and more. How? By putting the right commands in the right order, which is really what coding is all about.

Each lesson has a goal – which translates to a quest for Byte – that you’ll accomplish with the right bits of code.

For example, type moveForward(), then click Run My Code and watch Byte move forward. Congratulations, you’ve written your first program! (You can also enter Swift code by clicking specific commands – no typing required.)

Progress to Code Machine, Blu’s Adventure and other playgrounds as your skills improve. You’ll learn how to break a complex problem into small steps (a process called decomposition), dive into conditional statements and logical operators and explore other key topics. Before long, you’ll see how the apps you use every day employ the same simple commands you’ve learned.

Level up your skills

Ready to learn even more? Try Get Started With Apps to learn the basics of app development. Then head over to the App Gallery, where you can go deeper on topics like animating shapes, building an image gallery – even creating panda memes!

You can create apps with Swift Playgrounds – and submit them to the App Store!

Other topics include understanding and recognising gestures, building your own camera and creating an app of personal facts to introduce yourself.

Ready to go it alone? From the Playgrounds screen, click “+ Playground” to get a blank canvas on which to start from scratch.

Find the right command

Not sure which code or command to use? Smart Code Completion can help by suggesting commands and options relevant to the frameworks you’re using. Just select a bit of code to see the list.

Code anywhere

Sync your Swift Playgrounds data with iCloud Drive to jump in whenever inspiration strikes – on Mac or iPad. You can also import Swift Playgrounds projects into Xcode, the Mac app for professional app and game makers, to take advantage of Xcode’s advanced editing experience.

When you’re ready to take your ideas further, you can open your app playground in Xcode and use the same advanced editing tools used by the pros.

Share with a friend… or the world

When you’re ready to share your first (or next) app or game, you can send your code to a friend’s iPad or Mac using Mail, Messages or AirDrop; they can view – and edit – it in Swift Playgrounds.

Want a broader audience? Use the App Store Connect website to create a product page, invite users to provide feedback using TestFlight and gain insights on how users are engaging with your app. When you’re ready, submit your creation to App Store Connect directly from Swift Playgrounds.