In spite of Apple expressing a desire to switch its apps to Swift, just a handful of them are actually using the programming language so far, according to a software engineer.
The Calculator app is the only part of iOS 9.2 that includes any Swift code, Ryan Olson noted in a blog post. It is at least said to be nearly "pure" Swift, with only two of 22 classes written in Apple's previous favorite language, Objective-C.
Even Apple apps that are optional downloads from the App Store are generally reliant on Objective-C, Olson added. The official WWDC app makes use of some Swift, as does the Apple Store app's Watch interface, but even the former only contains Swift in six out of 281 classes.
The problem likely stems from several issues, such as the Swift Application Binary Interface not being finished. This should happen by Swift 3, but until then app compatibility may be too prone to breaking. There's also no 32-bit Swift runtime for OS X.
In December Apple's senior VP of Software Engineering, Craig Federighi, said that El Capitan's Dock and window management code was done with Swift, and that the iCloud team is "champing at the bit" to try the language. Deeper integration may have to wait until newer iOS and OS X releases later this year.
49 Comments
Don't eat much of their own dog food I guess?
Apple will catch up. Swift is a great language to develop with.
I say iOS 11 will be the first major release with more Apple apps using the language.
After 20 years away from hands-on development, I'm now learning Swift thanks to the excellent free training in iTune U (thanks, Stanford U!) and the free language books from Apple. I find it powerful and nicely concise due to its automatic inference of types and automatic memory management.
Apple's recent open-sourcing of Swift could lead to broader adoption at Universities, even if they don't have Mac hardware. (... once Swift compilers & IDEs are available on other platforms)
https://daringfireball.net/thetalkshow/139/federighi-gruber-transcript
John Gruber:
How do you manage as the chief mofo in charge of this? How do you manage the enthusiasm that you clearly have for Swift and, what to me seems like a sincere belief that Swift is the way forward — with the necessary conservativeness that you need so that there still has to be a lot of Objective-C written? How aggressive can you be about putting teams on, “Sure, go ahead and do that in Swift”?
Craig Federighi: People here are idealistic yet really pragmatic, and I think you see that as an Apple characteristic in many, many elements of what we do. And so, teams know, what the nature of what we’re trying to get done in their area in any given year, the nature of their code base, whether Swift is the right answer for them, or where it’s the right answer. Even teams where, for one reason or the other, they can’t jump right on Objective-C — or rather Objective-C conversion to Swift now. They then use Swift heavily for writing all their unit tests, which is great because then at least as they’re introducing new APIs, they’re experiencing their own APIs in Swift and then … sort of eating their own dog food in that regard. We do have some constraints internally which we’re addressing, but because we … I mean, it’s something in our closet a little bit, but we still support running 32-bit apps on the Mac. And the 32-bit runtime doesn’t actually support Swift right now. And so, what that means is that if we implement a framework that’s available to 32-bit code, we actually can’t write it in Swift. If that code, if that framework is used across iOS and OS X — as many of our frameworks are — that introduces a little stumbling block as well. So teams recognize what’s practical and what’s not practical and find ways to use Swift wherever they can. There’s no shortage of enthusiasm.
I am not doubting this is the case, but how does an engineer with Instagram know this?