A new version of the Swift programming language is coming: Swift 5.0. It’s slated to be released early 2019, with a fair number of changes. How does this Swift update affect practical iOS development? And who’s making these changes anyway?
In this article, we’ll walk through some of the proposed and accepted changes for Swift 5.0. We’ll also discuss how the process of making changes to the Swift language works, and why that’s relevant for iOS developers.
Version 5 of Apple’s Swift language used for iOS and MacOS application development will arrive in 2019 with ABI (application binary interface) stability in the standard Swift library a primary focus.
ABI stability is half of what is needed to support binary frameworks. The other half, module stability, will be a “stretch goal” for Swift 5 and may not make it into the release, Apple’s roadmap notes.
Carryover goals from Swift 4 that are prerequisites to locking down the ABI in Swift 5 include:
- Generics features for the standard library, including conditional conformances for generic types and recursive protocol types, lifting restrictions on associated types in protocols.
- API resilience, allowing public APIs for a library to continue to evolve.
- A memory ownership model, which will be partially introduced in Swift 4. Swift 5 will add pieces key to ABI stability to the Swift 4 memory model.
Aside from ABI stability, Apple expect the following improvements in Swift 5:
- String ergonomics , to improve processing of the string type. This could include new text-processing capabilities as well as language-level backing for regular expressions.
- Groundwork for a new concurrency model—but finalizing this model is not a goal for Swift 5. A key focus area will be designing language capabilities for building and using asynchronous APIs and dealing with problems created by callback-heavy code.
- Minor additions to the standard library.
- Targeted improvements to the Foundation API so the Cocoa SDK can work seamlessly with Swift. (Cocoa was originally designed for Objective-C, which Apple has been phasing out for three years.)
- Syntactic additions, with assessments to be done on degree of positive impacts.