Skip to main content

Swift is quickly rising in popularity as a developer language … but how much is Apple using Swift?

The TIOBE index uses search engine rankings to track popularity of programming languages. In January, Swift overtook Objective-C to become the 14th most popular language in the TIOBE index. The surge in popularity was spurred by the release of Swift into open-source in December. With developer interest growing, Ryan Olson was interested in how much Apple is using Swift for its own apps.

Despite producing the language, Apple is not ahead of the curve on Swift adoption. In his blog post, Olson finds that in iOS 9.2 only one Apple app uses Swift: Calculator.

Swift has quickly gained popularity among many third party developers, but what about for Apple’s own code? As of iOS 9.2, Calculator.app is the only place in the system that you’ll find any Swift. I expected to find at least a few other apps or frameworks that had incrementally adopted Swift for new code, but that doesn’t appear to be the case for now.

Calculator.app is actually almost “pure Swift” with only 2 of its 22 classes written in Objective-C. Just like third party apps that use Swift, Calculator.app has to bundle the Swift libraries it links to. There are no Swift libraries included with the OS because the ABI is not yet stable.

Calculator is being used as a testbed for Swift within Apple, apparently, written mostly in the new language. However, it’s the only stock app to use Swift. Usage beyond Calculator in iOS is non-existent. For its apps in the App Store, Apple has used Swift for its Apple Store Watch app and some parts of the WWDC app. On The Talk Show, Craig Federighi said that the OS X 10.11 Dock uses Swift. Beyond these cases, however, Swift usage in public Apple code is non existent.

Apple isn’t lagging behind for no reason. Federighi said Apple engineers are free to use Swift where it makes sense. Accounting for normal development timelines, the community is generally expecting significant uptake of Swift for Apple’s apps going forward, especially with OS X 10.12 and iOS 10 later in the year. The interoperability with Objective-C makes it straightforward for engineers to add Swift features gradually into existing projects.

[tweet https://twitter.com/catfish_man/status/688815036068827137]

A big factor for the lack of update is that the Swift Application Binary Interface (ABI) is not locked down. Until this happens, a goal for Swift 3, it is practically impossible for Apple to make stable Swift frameworks without breaking application compatibility with every release.

FTC: We use income earning auto affiliate links. More.

You’re reading 9to5Mac — experts who break news about Apple and its surrounding ecosystem, day after day. Be sure to check out our homepage for all the latest news, and follow 9to5Mac on Twitter, Facebook, and LinkedIn to stay in the loop. Don’t know where to start? Check out our exclusive stories, reviews, how-tos, and subscribe to our YouTube channel

Comments

  1. Robert - 8 years ago

    It’s not possible to come up with a new programming language over night and implement it everywhere the next day.

    This is happening gradually. Swift has a huge amount of momentum but it’s not yet ‘finished’ as a language, Apple is allowing it to be shaped based on feedback from those using it. There is a long way to go.

    It would not make sense for Apple to rewrite their existing apps in Swift just for the sake of using Swift. Efforts are better spent working on new stuff and supporting Swift in other ways, like updating and improving the Developers Library.

  2. just-a-random-dude - 8 years ago

    Didn’t Apple also say the reason Swift can’t take off too fast on OS X and iOS is because it doesn’t support 32 apps and Apple must still use 32-bit platform for now? I think Swift will take off faster once Swift 3.0 ABI is locked in, OS X/iOS stops supporting 32-bit devices, and so on.

    There is a reason that an increasing number of iOS features are starting to require 64-bit CPU iOS devices. I believe Night Shift in iOS 9.3 beta 1 only runs on 64-bit devices.

    In addition, Swift is still relatively new. You can’t rewrite apps into a language that’s young and still has breaking changes, especially critical stuff like an OS component. ABI is critical for many devs to have before they can even look at it.

    I would recommend we check in on this in 2-3 years after the Swift 3.0 ABI is released first to see how Swift adoption takes off.

  3. godofbiscuits - 8 years ago

    It’s probably primarily a case of “if it ain’t broke, don’t fix it”. In other words, the stock apps are stable and already written (in ObjC), so why do a full rewrite in Swift? In fact, to add new features to an app using Swift code included in the existing ObjC project is a testament to compatibility between the two languages.

  4. As far as I know, Apple has never suggested Swift was a replacement for Obj-c, it’s just that like Windows or Linux, you now have an actual language choice besides C derivatives. Not much choice, but it’s a decent one.

    That ‘a new language is available’ has nothing to do whatsover with making a decision to replace existing production-hardened code – those are a teams gold assets, and best case scenario of refactoring it is minimizing the man hours and new bugs you’ve introduced.

    The FUD about Swift 3 is curiously absurd. It in no way makes current development ‘Really Hard’ – it just means, like any major iOS release change, there will be a couple of days of refactoring – much of it perhaps optionally handled by Xcode and static analyzer – and you will have months of notice to address it in a release.

    The only apps it really affects are the ones which aren’t actively maintained.

Author

Avatar for Benjamin Mayo Benjamin Mayo

Benjamin develops iOS apps professionally and covers Apple news and rumors for 9to5Mac. Listen to Benjamin, every week, on the Happy Hour podcast. Check out his personal blog. Message Benjamin over email or Twitter.