Playing Around with Swift on the iPad
Stating that “We believe coding should be a required language in all schools,” Apple CEO Tim Cook announced during this year’s WWDC keynote that Apple was bringing the Swift Playgrounds app to iPads later this year. Swift Playgrounds is an environment designed to help developers try out code quickly, accompanied by a bevy of lesson materials. And it’s all free.
Since its debut at WWDC two years ago, the Swift programming language has become increasingly popular (see “Swift: Who Is Apple’s New Programming Language For?,” 12 June 2014). In no small part, that’s because of its clarity and simplicity compared to Objective-C, the de facto programming language for OS X and iOS development for years. The first version of Swift debuted with an Xcode feature called Playgrounds that developers could use to write and execute sample code quickly,
a boon both for learning the language and for prototyping code.
Swift Playgrounds for the iPad provides much of the same learning and prototyping capability as the Mac version and puts it on a handheld device. That makes it special already. Being able to craft and test a chunk of Swift code on the iPad and see how it performs is a boon to developers, who often may have programmatic inspiration strike while they’re miles from their keyboards. And that’s all without, mind you, having to run it in an iOS simulator on the Mac.
Add in a customized on-screen keyboard that provides all the special characters programming requires right on the main keyboard and include development-oriented QuickType assistance, and Swift Playgrounds becomes even more attractive. Supplement that with a code-snippet library for drag-and-drop coding, enhance it with a set of templates that offer working code to exploit iOS device features like the gyroscope and accelerometer, and throw in gestural editing (such as dragging to expand the scope of a FOR loop) and you have something really interesting.
Top it all off with the ability to easily import and export Playground code with Xcode on the Mac and you have a winning formula to entice developers to buy more iPads, as well as to lure hardened Objective-C developers to dabble in Swift.
But so much for developers who already know how to code. What about the kids? After all, aren’t playgrounds for kids?
They are, indeed. Most of Apple’s Swift Playgrounds for the iPad announcement and demo at the WWDC keynote focused on the lesson materials that Apple is also releasing with Swift Playgrounds. These lessons start slow, designed as they are for novice programmers at the grade-school level to sink their teeth into. The lessons feature puzzles to be solved and animated characters to be controlled by writing and executing Swift code. Accompanying them is a free book, part of Apple’s new “Everyone Can Code” initiative, titled “App Development with Swift,” as well as two teacher’s guides: “Swift Playgrounds (Teacher Guide)” and “App Development with Swift (Teacher Guide).”
The combination of Swift Playgrounds and its ancillary instructional materials may be a winning formula to attract more schools and families with school-age children into buying iPads. Which is, let’s remember, how Apple funds projects like this.
With Swift Playgrounds for iPad, Apple is working hard to broaden the reach of its app ecosystem to developers and would-be developers at all levels. Just as important, Swift Playgrounds and its instructional accompaniments could well counter the inroads that inexpensive Chromebooks running Google’s Chrome OS have made into the education market, where they have begun to supplant iPads in a number of schools.
Swift Playgrounds is available to developers now, with a public beta coming next month and with App Store availability by this fall, although it may not be tied to the rest of the operating system releases promised for the same timeframe.
I started coding on a ZX-81 in 1982, and I have seen many innovations since then, but found Swift Playgrounds on OS X to be a revelation. I am looking forward to seeing it come to iPad next fall. In the meantime, Codea is a real IDE that runs on your iPad today.
I wonder how it will compare to TapCoding, which just came out. Its days are presumably numbered since it's $10 to get all of the lessons.
I can beat Mike--I learned (and later extensively used) fortran on punch cards. Happily, I never had to use the original punch, which could do one character at a time, and you had to memorize the punch code for each character.
I started with COBOL on punch cards fed to an IBM 360/91. Good times!
To your main point: educational publishing is not necessarily a zero-sum game; one might well want to have a variety of instructional apps and books from different publishers.
So glad I never had to touch cobol. Do you remember the program to teach programming for the original mac (I'm blanking on the name). Similar to the new Playground, you had to teach a robot to go through mazes and past obstacles. A friend of mine cringes whenever it's mentioned, because it had structural flaws almost exactly like cobol, which he was forced to learn as a CS major.
What I really want is a complete logo with turtle graphics (preferably berkeley logo), so I can finally start working through Turtle Geometry by Abelson and diSessa. It goes from walking the turtle around a square, to the non-euclidian geometry needed for general relativity. I know I could translate to other turtle systems, but that's just enough extra overhead that I never start.
Chipwits! Written in the wonderful MacForth. There's a possibly useable rewrite (2008, mac and windows, written in adobe air) available as a free trial. There's a flash widget on the site, but I don't have anything that can do flash any more, so I don't know what it does.
http://www.chipwits.com/