All Mac and iOS apps are built with Apple’s toolset called Xcode, but central to Xcode is the language used to develop those apps called Objective-C. Objective-C has been Apple’s programming language of choice for more than 20 years, but coding is still a repetitive and imperfect process. Apple wants to help developers in this regard with its own homegrown solution, designed with simplicity and stability in mind.
“We had to ask ourselves the question: What would it be like if we had Objective-C without the baggage of C?” said Apple SVP Craig Federighi during Monday’s WWDC keynote.
Enter Swift, which was created to make writing apps faster, easier, and more efficient. Apple wants to make Swift a coder’s best friend, to create more stable better-looking results with less sweat and frustration.
And developers are excited. During Apple’s Swift demo yesterday, they were literally cheering and “ohhhing” and “ahhhing” over the new tools.
The bottom line: Swift means developers are going to be able to build better apps for you and do so much faster than before.
Why Apple Built Swift
There are programming languages like C and Objective-C, but there are also scripting languages (subsets of programming languages) that can execute code line-by-line to let developers see results as they’re writing the code, effectively making app development faster and easier than compiling each command — something you’d have to do with any high-level programming language like Objective-C.
Still, scripting languages — like Python, Apple’s most commonly used comparison for Swift — are imperfect. Since they’re typically used for the automation of simple tasks, scripting languages are somewhat limited by their performance, whereas programming languages like Objective-C are better for applications that need to access the full power of the device, particularly games.
That’s where Swift comes in. Described as a fast and modern solution designed for safety, Swift is faster than Objective-C or Python and “allows a level of interactivity never before seen on the platform” thanks to its support for “playgrounds” that allow developers to visualise Swift code in real-time within the Xcode developer environment. That means developers are able to see what an app looks like before they’re even finished coding it.
Coding in Swift is meant to be more concise, so you don’t need to write much to get a lot done. This aspect alone should speed up app development significantly. But the concept of “playgrounds,” which will allow developers to test apps as they’re written without worry of penalty, should make apps more responsive and easier to tinker with.
Swift is Apple’s play to lower the barriers of entry to becoming an iOS or Mac developer. By making coding simpler, more effective, and safe from major screw-ups — Federighi said common programming errors “are simply not possible.”
Swift might encourage a new wave of amateur developers to create tomorrow’s apps specifically for Apple’s desktop and mobile ecosystems.