Apple uses Swift and SwiftUI in iOS 15

Apple uses Swift and SwiftUI in iOS 15

[[441823]]

Preface

iOS 15 was released a few months ago in September 2021. In this article, I analyzed the built-in apps of iOS 15:

  • How many binaries are there in iOS 15?
  • What programming language was used to develop these applications?
  • How many apps have been written using Swift?
  • Is Apple adopting SwiftUI for some of its built-in apps?

method

The methodology and tools used to create this article are described in detail in my previous post. If you are interested, please refer to:

  • The evolution of programming languages ​​from iPhone OS 1.0 to iOS 14[1]
  • Apple used Swift in iOS 10.1 and macOS 10.12[2]

Before I get into the details, let me clarify a few points:

  • I only analyzed 'iOS' in the usual sense, i.e. everything above the kernel. The XNU kernel and low-level firmware (SecureROM, baseband, ...) are excluded. On the other hand, I counted frameworks located in the dyld shared cache introduced in iPhone OS 3.1.
  • Keep in mind that developers can mix different programming languages ​​to create a single binary. An example is the app I developed, Clutters[3], where I used Swift, SwiftUI, Objective-C, and C, using the most appropriate programming language to solve a specific Dev problem. For the purposes of this article, an app that contains a single line of Swift code will be considered to use Swift.
  • You will see Objective-C and C++ mentioned, but you may notice the absence of Objective-C++. The method used here cannot actually detect binaries built with Objective-C++. Such binaries are considered to use both Objective-C and C++.
  • Finally, you should take this analysis with a grain of salt. While I believe the overall picture is accurate, my approach has some limitations as I do not have access to the iOS source code and rely on imprecise compilation artifacts.

Swift and SwiftUI in iOS 15

Perhaps one of the most interesting numbers is Apple’s use of Swift and SwiftUI in iOS 15. So let’s start with that!

iOS 15 includes 114 binaries that use SwiftUI, nearly 3 times as many as iOS 14. Likewise, the number of binaries that contain at least one line of Swift code doubled between iOS 14 and iOS 15:

As you can see, Apple continues to gradually adopt Swift for its own built-in apps. This year has also been a big year for the adoption of SwiftUI. Some widely used apps now appear to be using SwiftUI in iOS 15:

  • books
  • map
  • memorandum
  • weather
  • hint
  • music
  • podcast
  • FaceTime ?(InCallService)
  • set up?

These new apps join the five previous apps that used SwiftUI:

  • translate
  • Shortcuts
  • Telephone
  • AirPods connection popup? (SharingViewService)
  • Lock screen? (SleepLockScreen)

The rest of the binaries using SwiftUI are mostly widgets or new frameworks. Here is the full list of the 114 binaries using SwiftUI:

  1. /Applications/AppSettings.app/AppSettings
  2. /Applications/AppStore.app/PlugIns/AppStoreWidgetsExtension.appex/AppStoreWidgetsExtension
  3. /Applications/FamilyControlsAuthenticationUI.app/FamilyControlsAuthenticationUI
  4. /Applications/FindMy.app/PlugIns/FindMyWidgetIntentsItems.appex/FindMyWidgetIntentsItems
  5. /Applications/FindMy.app/PlugIns/FindMyWidgetIntentsPeople.appex/FindMyWidgetIntentsPeople
  6. /Applications/FindMy.app/PlugIns/FindMyWidgetItems.appex/FindMyWidgetItems
  7. /Applications/FindMy.app/PlugIns/FindMyWidgetPeople.appex/FindMyWidgetPeople
  8. /Applications/FTMInternal-4.app/FTMInternal-4
  9. /Applications/GameCenterWidgets.app/PlugIns/GCWidgets.appex/GCWidgets
  10. /Applications/InCallService.app/InCallService
  11. /Applications/PeopleViewService.app/PlugIns/PeopleWidget_iOSExtension.appex/PeopleWidget_iOSExtension
  12. /Applications/SleepWidgetContainer.app/PlugIns/SleepWidgetExtension.appex/SleepWidgetExtension
  13. /private/var/staged_system_apps/Books.app/Books
  14. /private/var/staged_system_apps/Maps.app/Maps
  15. /private/var/staged_system_apps/MobileMail.app/PlugIns/MailWidgetExtension.appex/MailWidgetExtension
  16. /private/var/staged_system_apps/MobileNotes.app/MobileNotes
  17. /private/var/staged_system_apps/MobileNotes.app/PlugIns/com.apple.mobilenotes.SharingExtension.appex/com.apple.mobilenotes.SharingExtension
  18. /private/var/staged_system_apps/Music.app/Frameworks/MusicApplication.framework/MusicApplication
  19. /private/var/staged_system_apps/Podcasts.app/Frameworks/PodcastsStoreUI.framework/PodcastsStoreUI
  20. /private/var/staged_system_apps/Shortcuts.app/PlugIns/QuickLookExtension.appex/QuickLookExtension
  21. /private/var/staged_system_apps/Tips.app/Tips
  22. /private/var/staged_system_apps/Weather.app/Weather
  23. /System/Library/Assistant/UIPlugins/SiriFindMyUIPlugin.siriUIBundle/SiriFindMyUIPlugin
  24. /System/Library/Frameworks/_CoreLocationUI_SwiftUI.framework/_CoreLocationUI_SwiftUI
  25. /System/Library/Frameworks/_MusicKit_SwiftUI.framework/_MusicKit_SwiftUI
  26. /System/Library/Frameworks/FamilyControls.framework/FamilyControls
  27. /System/Library/Frameworks/FamilyControls.framework/PlugIns/ActivityPickerExtension.appex/ActivityPickerExtension
  28. /System/Library/Health/FeedItemPlugins/Heart.healthplugin/Heart
  29. /System/Library/Health/FeedItemPlugins/Highlights.healthplugin/Highlights
  30. /System/Library/Health/FeedItemPlugins/MenstrualCyclesAppPlugin.healthplugin/MenstrualCyclesAppPlugin
  31. /System/Library/Health/FeedItemPlugins/SleepHealthAppPlugin.healthplugin/SleepHealthAppPlugin
  32. /System/Library/Health/FeedItemPlugins/Summaries.healthplugin/Summaries
  33. /System/Library/PreferenceBundles/BatteryUsageUI.bundle/BatteryUsageUI
  34. /System/Library/PreferenceBundles/CoreRoutineSettings.bundle/CoreRoutineSettings
  35. /System/Library/PreferenceBundles/FocusSettings.bundle/FocusSettings
  36. /System/Library/PrivateFrameworks/AccessibilitySharedUISupport.framework/AccessibilitySharedUISupport
  37. /System/Library/PrivateFrameworks/ActionKitUI.framework/ActionKitUI
  38. /System/Library/PrivateFrameworks/CommandAndControlUI.framework/CommandAndControlUI
  39. /System/Library/PrivateFrameworks/CoreChartSwift.framework/CoreChartSwift
  40. /System/Library/PrivateFrameworks/CoreSuggestionsUI.framework/CoreSuggestionsUI
  41. /System/Library/PrivateFrameworks/FocusSettingsUI.framework/FocusSettingsUI
  42. /System/Library/PrivateFrameworks/FocusUI.framework/FocusUI
  43. /System/Library/PrivateFrameworks/HealthExperienceUI.framework/HealthExperienceUI
  44. /System/Library/PrivateFrameworks/HealthRecordsUI.framework/HealthRecordsUI
  45. /System/Library/PrivateFrameworks/HealthVisualization.framework/HealthVisualization
  46. /System/Library/PrivateFrameworks/HearingUI.framework/HearingUI
  47. /System/Library/PrivateFrameworks/MediaFoundation.framework/MediaFoundation
  48. /System/Library/PrivateFrameworks/MessagesSupport.framework/MessagesSupport
  49. /System/Library/PrivateFrameworks/MLKit.framework/MLKit
  50. /System/Library/PrivateFrameworks/MLKit.framework/PlugIns/com.apple.MLKit.MLModelPreview.appex/com.apple.MLKit.MLModelPreview
  51. /System/Library/PrivateFrameworks/MLKit.framework/PlugIns/com.apple.MLKit.MLPackagePreview.appex/com.apple.MLKit.MLPackagePreview
  52. /System/Library/PrivateFrameworks/NotesUI.framework/NotesUI
  53. /System/Library/PrivateFrameworks/PaymentUI.framework/PaymentUI
  54. /System/Library/PrivateFrameworks/PeopleUI.framework/PeopleUI
  55. /System/Library/PrivateFrameworks/PreviewsInjection.framework/PreviewsInjection
  56. /System/Library/PrivateFrameworks/PreviewsMessaging.framework/PreviewsMessaging
  57. /System/Library/PrivateFrameworks/ScreenTimeUICore.framework/ScreenTimeUICore
  58. /System/Library/PrivateFrameworks/SleepHealthUI.framework/SleepHealthUI
  59. /System/Library/PrivateFrameworks/SleepWidgetUI.framework/SleepWidgetUI
  60. /System/Library/PrivateFrameworks/SnippetUI.framework/SnippetUI
  61. /System/Library/PrivateFrameworks/TipKit.framework/TipKit
  62. /System/Library/PrivateFrameworks/TranslationUI.framework/TranslationUI
  63. /System/Library/PrivateFrameworks/TranslationUIServices.framework/PlugIns/TranslationUIService.appex/TranslationUIService
  64. /System/Library/PrivateFrameworks/VideosUI.framework/VideosUI
  65. /System/Library/PrivateFrameworks/WeatherUI.framework/WeatherUI
  66. /System/Library/PrivateFrameworks/WorkflowUI.framework/WorkflowUI
  67. /System/Library/Snippets/UIPlugins/AudioUIPlugin.bundle/AudioUIPlugin
  68. /System/Library/Snippets/UIPlugins/SiriVideoUIPlugin.bundle/SiriVideoUIPlugin
  69. /System/Library/Snippets/UIPlugins/SystemPlugin.bundle/SystemPlugin
  70. /usr/lib/swift/libswiftExtensionKit.dylib
  71. /usr/libexec/proximitycontrold

Total number of binary files

How many binaries can we find in iOS 15?

iOS 15 consists of 4738 binaries, up from 4173 in iOS 14. There are 565 new binaries.

Number of binary files

The evolution of programming languages

We can see the evolution of the programming language used by iOS by analyzing all major iOS versions from iPhone OS 1.0 to iOS 15. Note again that a binary file can be evaluated multiple times, so the sum of the binary data in this graph is greater than the total number of binaries:

Number of binary files using various programming languages

In all binaries for iOS 15:

  • 89% used Objective-C
  • 17% used C++
  • 13% used Swift
  • 8% use C completely
  • 2% used SwiftUI

What can we learn from this?

  • Objective-C is still at the core of iOS and isn't going away anytime soon.
  • Apple's adoption of Swift is progressing faster than ever. Last year, Swift surpassed C. This year, Swift is getting closer and closer to C++.
  • SwiftUI was barely noticeable last year, but this year Apple seems to be adopting it more widely, even in flagship apps.
  • C++ and C still play an important role. These languages ​​are often used for binaries related to audio, video, telephony, networking, and other low-level frameworks.

Here is another representation of the evolution of various programming languages:

The evolution of various programming languages

Raw data

If you want a more in-depth analysis, you can download below the raw data I generated for all major versions of iPhone OS from 1.0 to iOS 15.0.

in conclusion

Even though we don’t have access to the iOS source code, we can identify the programming languages ​​used to create built-in apps in iOS and measure the evolution of those languages ​​from iPhone OS 1.0 to iOS 15.

As we’ve seen, Apple continues to adopt Swift for its own apps: the number of binaries using Swift doubled between iOS 14 and iOS 15. About 13% of binaries now use Swift. Additionally, Swift UI adoption really started this year, with several flagship apps now using SwiftUI.

As mentioned earlier, this approach obviously has some limitations, and while I think the overall picture is accurate, I cannot guarantee that the results are completely accurate. If you think I've missed something, please reach out to me on Twitter.

Translated from: Apple's use of Swift and SwiftUI in iOS 15

References

[1] The evolution of programming languages ​​from iPhone OS 1.0 to iOS 14:

https://blog.timac.org/2020/1019-evolution-of-the-programming-languages-from-iphone-os-to-ios-14/

[2] Apple used Swift in iOS 10.1 and macOS 10.12:

https://blog.timac.org/2016/1101-apples-use-of-swift-in-ios-10-1-and-macos-10-12/

[3]Clutters:

https://apps.apple.com/app/clatters/id1480930237

<<:  Ministry of Industry and Information Technology: Problems such as the inability to turn off pop-up messages on apps have been basically resolved, and work has made phased progress

>>:  WeChat PC version has launched a new feature! Web version of the file transfer assistant is here

Recommend

Photoshop Art Title Design Course

Photoshop Art Title Design Course Resource Introd...

Car rental travel platform user operation system (1): channel promotion

This article builds a complete user operation sys...

Valuation Modeling Skills Enhancement Course 5

Whether it is a written interview or an internshi...

Who will win the battle of smart TVs?

Since the emergence of Internet TV in 2006, smart...

SOP for high conversion, traffic generation and promotion courses!

The underlying logic of the traffic-generating co...

Douyin private domain solution and four core capabilities

01 Positioning and value of Douyin private domain...

Stay away from big trucks! The driver really can't see you!

Audit expert: Zhu Guangsi Member of Beijing Scien...

5 fish pond models operated by Xiaomi, Get, and Li Ziqi fans

Fan/customer operations have been mentioned all t...

The most inaccurate indicators measured by smart watches are actually these...

From heart rate, blood pressure, sleep to energy ...