Apple released Swift 5: Reduced iOS 12.2 application size

The most significant change in the Apple Developer ecosystem over the past decade has been the introduction of the Swift programming language, and the next major change that may be seen on WWDC this year is the introduction of third-party UIKit applications on the Mac program.

Swift, this new language was announced at WWDC 2014. It has been iteratively updated several times with the contributions of Apple engineers and the open source community, now in version 4.2.1.

An important aspect of Swift that has been affecting users since the first release is that its application binary interface (or ABI) is unstable. This in practice means that Apple can’t include Swift language support in its operating system, because applications written in Swift 3 will not work with Swift 4’s language support binaries. The solution is to include the language library in the app bundle that Swift downloads from the App Store, but this increases the bandwidth and storage space required by the application.

According to foreign media news, Apple has started using the latest Swift 5, and the language becomes binary compatible. The new version is included in iOS 12.2, Vos 12.2, watchOS 5.2 and macOS 10.14.4, all of which are currently in the developer test phase. This means that when a new version of the Apple operating system is available to users, applications published to the App Store using the Swift 5 programming language will be much smaller for users running the new operating system.

Another benefit is faster startup time because each dynamic library used by the application will slightly increase its startup time, but the libraries shipped with the operating system will be cached in memory and shared among all applications.

But how much storage space is specifically reduced? Download some apps from the App Store and check how much space the Swift library takes up. Here are some examples:

Apollo for Reddit is 35.7 MB in size and includes a 7.5 MB Swift library. When updated to Swift 5 in iOS 12.2, the application size will be reduced by more than 20% to less than 30 MB. The PCalc is 86.8 MB in size and includes a 7.5 MB Swift library. After updating to Swift 5, the application size will be reduced by 9% to less than 80 MB.

The Apple Watch has a Chirp size of 28.8 MB and contains an 11.6 MB Swift library. After updating to Swift 5, the application size will be reduced by more than 30% to less than 20 MB. This app saves the most compared to our computing application because it includes an Apple Watch app written in Swift, including the Swift library for watchOS.

The storage space saved varies from device to device. The above uses the application size on the iPhone XS Max as a reference but saves more space considering the device with many applications installed.

Of course, this is based on the assumption that developers will adopt Swift 5, but most applications written in Swift will be actively maintained and the migration will not be too difficult. The new version of the language also includes a pattern that is compatible with the code written for Swift 4.2, which will make it easier to migrate developers with large amounts of code.

All users must take advantage of this to update to iOS 12.2, Vos 12.2, watchOS 5.2 and macOS 10.14.4, and wait for developers to update their applications. Currently, all systems are already open to developers. Applications built with Swift 5 and published to Test Flight have saved space for users running betas.

Leave a Reply

Your email address will not be published.