2nd June 2014, changed the world of iOS and OS X development – forever.
This time last year iOS developers across the globe had no idea that in a few days Apple would launch a brand new programming language called Swift at their Worldwide Developer Conference. We were streaming the WWDC keynote live in London when Apple announced the arrival of Swift. I remember looking over at Richard, our Head of App Dev and creator of Amsys iOS Development training, with his jaw on the floor.
That same evening, Apple released the full documentation for developers to pore over and learn the Swift Syntax!
Media badge people are silent, attendees going nuts. This is huge huge news, the future of all Apple development.
— John Gruber (@gruber) June 2, 2014
Why did Apple create Swift?
Apple had been working on Swift for around 4 years prior to its launch. Back then, iPhones and iPads were surging in popularity with consumers; meanwhile enterprises were quickly following suit.
However, the demand for iOS developers was fast outstripping supply. So Apple embarked on a mission to create “a new language that lets everyone build amazing apps.”
“Because the people who are crazy enough to think they can change the world, are the ones who do.”
Apple intended to remove the association that programming is hard to learn and the remit of a select few. To do this, Apple needed to move away from Objective-C.
Even though Objective-C had “served Apple incredibly well” over the previous 2 decades – it relied heavily on C. Consequently, there were a number of limitations, which meant the language couldn’t change or evolve as quickly Apple would have liked.
Objective-C also has a rather verbose syntax, quite different from other mainstream languages, which can put some developers off from learning it. To bring Swift into the mainstream, Apple borrowed ideas from a number of languages including Objective-C, Rust, Haskell, Ruby, Python and C#.
OK, time to learn #swift language pic.twitter.com/dxRszPobCP
— MarcoTTe (@marcote_torres) June 2, 2014
How did the developer community react?
Change, in all its forms, is usually met with some resistance. When Apple released Final Cut X, the reaction was “bitter and emotional.” Therefore, it was no surprise that feedback from the developer community was mixed. Although there were many brimming with positivity and excitement.
Indeed, existing developers of non-Apple languages who disliked Objective-C’s syntax were even inspired to start learning Swift.
“As a C# developer, I can read and understand the code without any issues. That’s a good thing for Apple. I’m sure Objective-C is great but it’s too foreign for me and didn’t want to toy with it for fun, not worth the effort. But I can write an app or two with this one.”
Within days… a Swift version of the hit app “Flappy Bird” was released on Github – validating Apple’s claim that Swift is easy to learn language. Then, in October 2014, LinkedIn announced that they had developed their first iOS app only using Swift.
“We began working in Objective-C for two weeks, and then when WWDC came around, we heard about the new language and decided to go all in on Swift and start from scratch.”
Unprecedented demand & adoption
By January 2015, Swift was predicted to become one of the top 20 languages by Q3 in the ranking guide released by analyst firm, RedMonk. A feat that took Google’s Go – 5 years to achieve. What’s more – a survey released in Feb 2015 revealed that a massive 20% of developers had already started to use Swift.
Swift has also given birth to a new community of developers – new and existing, populated with members eager to learn and to get a foot on the development ladder. Today there are 92 Swift meet up groups with a total 23,000 members, across 68 cities in 27 countries, each providing monthly talks and workshops.
Within weeks of WWDC 2014, various free and paid for resources popped up across the web to help more people learn how to code. Here at Amsys we also jumped at the chance to create a range of Swift training courses and exams, the 1st of which was launched last Summer, and subsequently grown in popularity ever since.
Not Just a Flash in the Pan
As Swift’s stability and adoption rate grows, more and more enterprises and their in-house developers will start to accept Swift as a commercially viable language.
So… what does it take to develop apps using Swift?
Because of its history, Objective-C has a lot of legacy that involves using many [ ] and @ symbols, which does not make it the most readable language. Swift does away with all this.
Swift is much more readable, borrowing heavily from languages such as Rust, Haskell and Python. Swift code is much easier to maintain, requires less housekeeping than Objective-C.
Swift is is also safer to use, hiding pointers and forcing developers to declare the type of data being used within the app. Swift also requires less code and produces faster code than Objective-C.
To develop in Swift, you obviously need an understanding of the language.
From our experience, Swift is easier to pick up than other languages, and if you come from another language you will certainly find it very familiar. Once you get into the iOS or OS X frameworks, the building blocks of any app, you will notice they are identical in functionality, they just differ in their syntax.
If you’re coming from Objective-C to Swift, you should feel right at home.
The future…
WWDC 2015 will certainly bring us up to date to with Swift. Apple has not rested on their laurels this last year They have delivered a number of updates to the language as well as their developer tools. Only Apple knows what will be announced, but the developer community cannot wait.