When it released iOS 10, Apple also officially introduced Swift Playgrounds, an app designed to teach anyone the principles of coding using Swift. But is Playgrounds your best option for learning to code in Apple’s newest language, especially with so many learn-to-code platforms and apps competing for your attention?
Kids are Swift Playgrounds’ target demographic: the app is cartoonish, and based around navigating a few characters through mazes as a proxy for learning how to code. In order to help out beginners, it relies on pre-fabricated code snippets and a clever custom keyboard to help alleviate the tedium of writing code (and keep the young ones interested).
At its core, the app is teaching you to write effective code. If a puzzle calls for your character to walk three paces, turn and walk three more, those actions must be broken out step-by-step (so to speak). Instead of asking a character to go to a particular position (as you would in a video game), Swift Playgrounds teaches you that each action is its own process.
Although Swift Playgrounds focuses heavily on the Swift programming language, Apple suggests the app isn’t meant to sway you towards iOS or macOS development; the aim is to teach you core coding principles.
The program is a more approachable way to learn Swift than Apple’s own Swift documentation, which is tedious and would probably dissuade an eager learner from trying to code.
If you’re not interested in Playgrounds, however, there are some other apps that can teach you how to code:
There are other iOS apps that can teach you Swift, if that’s your focus. Those apps can be used on both iPad and iPhone (Swift Playgrounds is limited to iPad), enabling you to learn anywhere you go.
Swifty is one of the more popular options, and walks you through each of the tools you’ll be using in basic coding such as boolean values and variables. It then moves into optionals and subclassing. It’s a fairly static app, relying on the written word to teach you how to code.
Code! is another app that relies on text to teach you Swift, but takes things a step further with a wider menu of lessons and tips. Like Swifty, Code! asks that you fill in some blanks on static lines of code. The concept is helping you understand the overall scope of how programming works. And if you get stuck, Code! has video tutorials that ease you past your stumbling block.
The problem with apps like these (and there are many) is you’re not seeing code work. With Swift Playgrounds, you hash out some code and see it running in a visual environment immediately, much like you would in Xcode when you hit ‘build.’
But the upside of these apps is portability. Catching a few lessons while on the train home from work or during a lunch break is easier with Swifty, Code! and similar apps.
Swift Playgrounds is in a position to do much more than these apps can. With visualization and instant feedback, Apple achieved something with its app nobody else can approach right now. Even though you can import Playgrounds from Xcode into Swift Playgrounds (which invariably means enterprising educators from every corner of the globe will create their own lesson plans) the handy visualization is not yet available to all, and it’s really special when you’re first learning how to code.
Some Learning Courses
If you’re looking for a more traditional method of learning Swift, but don’t want to go back to university, there are some very good programs available to you.
Udemy offers courses created by knowledgeable people, but they may not be accredited educators. Coursera has coding classes from top universities, but it’s not a full course-load. With either, your mileage will definitely vary.
Udacity takes the idea of formal education and wraps it in digestible online classes. Taught by its own staff, Udacity gives a bit more polish to the less-traditional online education platform, going so far as to offer a ‘Nanodegree’ to those who complete its various programs.
Treehouse takes it a step further. More formal than Udacity, Treehouse courses are also taught by its own staffers, and have a more formal process for students to navigate. Unlike some other courses, you don’t dive straight into making an app. Instead, you start with Xcode Playgrounds, then make your way to Xcode proper.
Treehouse even offers a proctored final exam, and a very active Slack channel for each of the 12 projects you make throughout the course. If you need one-on-one help, Treehouse staffers are available for dedicated tutorials. It feels more like a proper education than an online course.
Because Treehouse focuses on teaching fundamentals that provide a stronger foundation for long-term success as a developer, it prevents you from rocketing through the course; and while it’s obviously a move to solidify monetization of the platform, Treehouse says it’s also about making sure students absorb what they’re learning rather than rushing to finish a degree and find a job.
No Right Way to Learn Swift
Like the proverbial rabbit’s hole, it depends on how deep you want to go.
If you’re interested in a casual understanding of the language, apps like Swifty and Code! are a great source. When you’ve finished making your way through the bite-sized lessons, you’ll have a better understanding of what the language can do, and how to make it perform tasks that are building blocks for apps.
While Swift Playgrounds is a bit cartoonish and off-beat, it’s much more robust than other iOS apps dedicated to learning Swift. The core lesson plan teaches you in real-time how code works, and its sharp visualizations of your code actually working is the best way (mobile or desktop) to learn where you’re going wrong (which is a lot of what developing apps is about anyway).
It’s also extensible. Apple will be creating more lesson plans for Swift Playgrounds over time, no doubt driven by its new education initiative for schools. If nothing more, Swift Playgrounds is a solid environment for learning and experimentation.
And although Apple’s official position is that Swift Playgrounds isn’t dedicated to teaching Swift, every programming language produces its own gravity. Playgrounds can’t escape Swift’s, no matter how hard Apple tries to talk its way out of the vortex. You’ll get a solid foundational understanding of computer science principles with Swift Playgrounds, but it’s still very much about Swift.
But Swift Playgrounds won’t leave you ready to dive into Xcode to create an app. If that’s your goal, using the app as a springboard to a Treehouse course is probably your best bet. You’ll go from a mobile Playgrounds environment to the desktop, which feels immediately familiar—and by the time you’re creating real apps in Xcode, it’ll feel like a natural progression.