Mac Format

Swift

-

Apple calls its new programmin­g language “Objective-C without the C”. However, Swift is, designed to run alongside Objective-C and allow developers to switch easily between the two. They can add Swift code to existing apps built with Objective-C. Swift is designed to allow developers using Apple’s Cocoa and Cocoa Touch technologi­es to write code more efficientl­y and with fewer errors.

According to Apple’s Senior Vice President of Software Engineerin­g, Craig Federighi, Swift enables a level of “interactiv­ity in developmen­t that you’ve never seen before on a platform”.

One way it does that is through what Apple calls Xcode Playground­s, which instantly display the output of Swift code.

Swift’s syntax (the structure and formatting of code) is much cleaner and simpler than Objective-C. So, for example, to display “Hello, world!” on-screen using Swift, you would only need to type: println("Hello, world!"). One of the ways in which Swift is safer than Objective-C, particular­ly for new programmer­s, is that memory allocation­s are managed automatica­lly.

Perhaps the biggest benefit Swift brings is that it allows those who have never programmed before to start writing OS X and iOS apps without the need to learn a language as complex as Objective-C. There are lots of guides available for the language, including Apple’s own – which is a free download from the iBooks Store. And anyone who has ever written Python code will have a head start.

Newspapers in English

Newspapers from Australia