Swift, the language developed at Apple and released in 2014, is nearing version 5 – and a level of settled-in maturity expected for a language that has the ability to work across platforms. But how well is it doing within its own ecosystem?
Engineer Andrew Madsen took a hard, objective look at the top 110 apps in the App store to decipher the popularity of Apple’s language. He ran those apps through a Python script he wrote, noting: “For an app to be considered to ‘use Swift,’ it must include
libswiftCore.dylib in its Frameworks folder, and it must have at least one Objective-C compatible Swift class in the main executable.”
Madsen added: “Some apps don’t use Swift in the main executable but include dynamically linked frameworks that use Swift. For this analysis, those apps are not counted as using Swift, because I wanted to get an idea of how many apps themselves were being developed in Swift.”
His findings show 42 percent of the top 110 apps in the App Store use the language. We should note this doesn’t mean those apps were written entirely in Swift, just that they use it (based on Madsen’s qualifiers noted above). When he eliminated games from the mix, that number jumped to 57 percent.
This means 58 percent of apps are not using Swift (dropping to 43 percent when we exclude games entirely). Madsen acknowledges imperfections in his methodology, writing: “It will still count an app as using Swift if that app includes a staticly linked Swift library, even if the app’s own code doesn’t use Swift.”
He also published his raw data, showing which apps use Swift most, and which ignore it completely. The number of ‘zeroes’ in his GitHub Gist probably won’t surprise you; apps like Snapchat, Waze, YouTube, Amazon, Candy Crush Saga, and Facebook all skip right over the upstart language.
Some apps have a surprisingly large percentage of Swift-based code; WalMart for iOS uses 80 percent Swift, for example. Admitting his methodology doesn’t appreciate for Swift types that aren’t Objective-C classes, Madsen notes the script “determines the percentage of the app written in Swift by finding all the Objective-C exposed classes, and counting those written in Swift vs. those written in Objective-C.”
Microsoft Outlook is at 67 percent; so is Postmates. Tinder is 47 percent Swift. Starbucks? 35 percent. Hulu is 62 percent Swift, which is particularly interesting because Netflix is at zero percent (Prime Video is at 12 percent). LetGo won’t let go of Objective-C; it’s only at 41 percent Swift.
There are many apps with small percentages on Madsen’s list, but a troubling trend emerges on closer inspection. None of the games listed in the top 110 apps on the App Store use Swift at all. We identified about 15 games in the list, and while there’s some room for argument over whether we should include or exclude some titles, none of the games we found within the Gist were using the language in any way. (Curiously, 15 percent is the delta between “all apps” and “non-game apps” when appreciating Swift’s use in the iOS app ecosystem.)
Swift is gaining LSP and ABI stability, which are two pillars for its long-term viability. This could help the language with cross-platform apps, both for Apple’s incoming ‘Marzipan’ tooling and other platforms. Developers’ need for cross-platform compatibility is likely a cause behind its lack of adoption amongst top games; in an effort to write once and publish to multiple app stores, game developers have chosen languages and frameworks other than Swift.
Shortly after Swift’s launch, about ten percent of the top apps were utilizing the language. Considering 42 percent of iOS apps currently use it, that’s ten percent year-over-year growth within the iOS ecosystem. That’s notable, and impressive, especially when you consider that metric was reached without lynchpin features such as LSP and ABI stability. It’ll be interesting to see the percentages in another three years; we expect the number of top apps utilizing the language to rise steadily, but we’re also curious to see how much of the language they’re using, and whether large companies such as Amazon, Google, and Facebook begin using it in place of their own frameworks and languages such as React.
In addition, we wonder if Apple will tighten restrictions in the App Store for outside languages and frameworks. We’ve already seen what appears to be a shadow-war against React, and with privacy concerns coming to the forefront, we wouldn’t be surprised if more restrictions snapped into place.