So Apple's introduction of Swift last week (see our initial thoughts on iOS 8) had to be the biggest news to came out of their developer conference. No longer are developers tied down to making apps in Objective-C, they can now create apps in a brand new language called Swift.
Swift builds on the best of C and Objective-C, without the constraints of C compatibility, in other word it’s like Objective-C but without C. Tim Cook talked on stage at WWDC about some of the new features of Swift for example generics, type inference, multiple return types, closures and many more. It looks like developers will not be losing anything from moving over to Swift in fact will be gaining a lot more.
As well as a new language, Apple have also released a new development feature for Xcode (the development environment) called Playgrounds. Playground allows developers to test their code without leaving Xcode, seeing the results of their code being built by the LLVM complier in real time as they type. I think this is a great feature, it allows us to test chunks of code without running the simulator every time we make a small change.
So what are the main differences to Objective-C and how could it effect the way we work as a business?
Swift is Fast. Apple showed that Swift can carry complex object sorts and RC4 encryptions a lot faster than Python and Objective-C. Swift supports type safety meaning it knows a lot more about the objects and types which belong to a given method. This means Swift does not have to use dynamic dispatch like in Objective-C to find out where the method has come from, instead it can jump straight to the implementation. These features along with a much smarter complier will allow us to create apps faster and of a higher quality.
Swift is a new language and from what I have seen so far I am very impressed with it. However we won't be switching over to it straight away. We currently have five iOS developers including myself, and to get everyone up to speed on a brand new language whilst keeping all our projects on track would be un-realistic. What we will be doing though is slowly adopting Swift into our current projects. As Xcode lets you use Swift side by side with Objective-C we can still deliver quality apps whilst meeting clients tight deadlines.
These are the thoughts from the rest of the team.
Rodrigo - I am normally the first to admit it, when I came across Objective-C for the first time, the first words out of my mouth was “what’s with the overuse of [ ]”? It looks terrible! The more I looked at the code the more I felt disenchanted with it. As the years went by since its first introduction thanks to Apple’s iPhone and being a mobile developer myself, I had to bite the bullet and learn it. The Swift language aims to remove that resistance. This will most certainly increase the influx of application submissions to Apple’s app store as the language uptake increases by the tenfold. We’ll see great (and terrible) applications in the app store and the competition even greater.
Chris - I had a sudden shock when Swift was announced at WWDC. I immediately thought, “why do we need a new programming language when Objective-C is so widely adopted already with the iOS and Mac community?” but then I took a step back and remembered, I know a lot of people who are resistant to look into Objective-C as it is a totally different layout to other languages, Swift on the other hand changes all that. We will just have to wait and see if it catches on with new and current programmers to the platform.
Degree 53 have developed many native applications for iOS for both iPhone and iPad as well as Android, Windows and Windows Phone. If you would like to find out further information don’t hesitate to contact us.