O'Reilly logo

Mastering Cocos2d Game Development by Alex Ogorek

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Learning Swift through Playgrounds

Playgrounds offer a way to test your Swift code quickly and easily without much baggage that usually comes when creating a test project in another language. They're intended as files used for prototyping and quick fiddling with code if you have problems with a small section. They're really easy to use and understand, so let's begin.

Note

The first thing you'll notice about Swift is that there are no semicolons required (except when writing multiple statements on one line, which must be separated by semicolons). That's right—none! They're optional, but the preferred style of writing Swift code is without semicolons.

Also, when coding if statements, loops, switch statements, and so on, you must use curly braces around ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required