Sunday, 29 March 2015

Learn Apple's New Programming Language 'Swift' with Swifty


Apple surprised almost everyone at WWDC last summer with the announcement of Swift, a new programming language for iOS and Mac development.The language feels like something Apple would invent. Like several of the languages currently popular in web development, it has a concise, readable syntax that’s easier to pick up than Apple’s older language, Objective-C. It was engineered by Apple’s compiler experts, so in addition to being compatible with existing code and Cocoa libraries, it’s also faster by some metrics.
Apple and its developer community have done some job getting lessons out there. The same week Swift was announced, Apple released a version of Xcode with support for the language, released a free book detailing the syntax and launched a blog with posts detailing updates and best practices. Even the Stanford iOS course shifted from Objective-C to Swift.


For those just starting their journey into the world of coding, however, those resources are still intimidating to jump into. Enter Swifty, an app that provides an interactive set of tutorials that gradually guide you through the basics of Swift on your iPhone or iPad.








There are more than 200 tutorials in Swifty, starting with the very basics of variables and data types and progressing to the essentials of object-oriented programming.



The iPhone keyboard isn’t the best tool for cranking out lines of code (especially if you’re just starting out), so creator Johannes Berger came up with an interesting interface that looks and feels like coding while actually acting more like an interactive quiz.








Each tutorial in Swifty starts with a brief explanation of a new concept or an important aspect of a concept previously covered. Below, you’re shown a few lines of pre-written code, with a blank field where some vital name, type or value is missing. When you tap it, it lets you choose from several options. If you choose one of the correct options (sometimes it gives you several that work to demonstrate different output), it “runs” the code and shows the result.

Now, the output from the “console” at the bottom of the screen is pre-written — you’re not actually writing working code in the app. But the format quickly gets you comfortable with the look of Swift code and things like naming and accepted styles for creating blocks of code in functions or classes.

If you are not sure about the app (or even learning the language itself), you can make your way through the app’s first 13 tutorials for free. Going further than that would cost you $2.99 to unlock the app and all it's lessons.

No comments:

Post a Comment

Translate

Popular Posts