Behind the noise of Apple’s big services announcements, Swift 5 and Xcode 10.2 were released, significant upgrades that should make accelerate app development and distribution.
Swift 5 brings ABI stability
Source-compatible with Swift 4 or later, Swift 5’s flagship feature is the introduction of ABI stability, which means the Swift runtime is now included in macOS, iOS, tvOS, and watchOS. Apple says when you upload apps for sale at the App Store, it “thins the Swift runtime from your apps for faster downloads to devices running the latest OS.”
This has multiple positive impacts:
- It will accelerate the development and distribution process when building apps to work across all Apple’s devices.
- Apps will be smaller, as the Swift code they require is already available to the system.
- Apps should launch faster, deliver better performance, and haveimproved memory management.
- Customers should find apps faster to download, install, and use if running them on the latest devices.
- Apple will be able to deliver platform frameworks using Swift in future operating systems.
Apple’s decision to make its services available across all its platforms illustrate how important it thinks it is to offer apps that work across all its products. Developers should pay attention to this as the ways people engage with tech continue to diversify.
Foundations for a Swift future
There is a downside to the decision to make Swift an operating system component – in the event a developer wants to switch their app to a different Swift runtime they may find they need to wait until an appleOS version that supports those features appears.
“This trade-off between adopting new language features and frameworks or maintaining compatibility with older OS versions has always existed for Objective-C and Apple system frameworks, and will now be a factor for Swift as well,” Swift.org observes. There may also be problems around enabling support for new Swift features on older operating systems, but apps should continue to run in the normal way.
There are some other foundational improvements from which Apple hopes to build future versions. For example, a note on Swift.org mentions that Module Stability is the next big aim of the project, and this may arrive in beta form as soon as WWDC 2019.
Additional improvements that Swift 5 provides
While interest in Swift isn’t exactly waning, the language has seen what was once surging popularity among developers ebb slightly. Sure, it is one of the top languages around, but there continues to be the now traditional resistance from some Linux developers to adopt a language so closely associated with Apple. However, the ability to make apps faster, ship them more quickly, and enjoy platform-native status may help rekindle interest in Swift 5.
Additional features in Swift 5
The release also includes:
- A reimplementation of String with UTF-8 encoding, which may speed code.
- Result and SIMD vector types in standard libraries.
- Performance improvements.
- The enforcement of exclusive access to memory during runtime.
- Performance improvements to Dictionary and set.
- Swift Package Manager enhancements include things like target-specific build settings, customized deployment targets, and more.
Where can you get Swift 5?
Swift 5 is already included within Apple’s Xcode 10.2, while binaries are also available for Ubuntu Linux. Development of Swift 5.1 has already begun and is expected to ship in beta at or around WWDC 2019.
Learn more about Swift 5
Please follow me on Twitter, or join me in the AppleHolic’s bar & grill and Apple Discussions groups on MeWe.