Apple has released Swift 5.5, the latest version of its open-source programming language for building apps on iOS, macOS and other platforms.
Apple announced Swift 5.5 in June at its annual developer conference WWDC with headline features including ‘Swift Concurrency’ for asynchronous and concurrent programming, improved package management and distribution, and standard library packages.
One notable change was that developers can now grab packages from a search screen in Xcode, Apple’s IDE or integrated development environment. So-called “package collections”, or selected lists of packages, make it easier to distribute and consume collections of packages for specific uses. Swift 5.5’s package manager also added support for package collections.
Apple unveiled Swift in 2014 as the modern replacement to Objective-C and it quickly became a staple programming language for building apps for iOS and macOS computers.
Tiobe, which regularly publishes a list of the most popular languages, has argued that Swift adoption was hampered by the availability of languages that supported cross-platform mobile development.
Nonetheless, the Swift project says Swift 5.5 is a “massive release”.
Swift isn’t just for Apple hardware. It is available for developing apps that target Windows 10 as well as Apple’s Arm-based Macs, Linux servers, and AWS’ Lambda no-server platform.
Apple also promised major performance improvements in Swift 5.5 via incremental imports that cut the number of files that need to be recompiled when imported modules change. This lets developers take a modular approach to a software project and reducing performance obstacles.
Another highlight is concurrency interoperability with Objective-C, which links Swift’s concurrency features such as its async functions with Objective-C.
“It is intended to allow the wealth of existing asynchronous Objective-C APIs to be immediately usable with Swift’s concurrency model,” Swift contributors explain.
Swift 5.5 also promises major improvements to memory management, with changes in Xcode 13 allowing Swift programs to reclaim memory more quickly. Automatic Reference Counting or ARC relies on the Swift compiler to automatically free up memory when it’s not needed.
This version also introduces another Swift type called “Actors”, or a reference type that protects access to its mutable state.