Mobile

Swift 4.2 releases with language, library and package manager updates!

2 min read

The Swift team released Swift version 4.2 yesterday. Swift 4.2 comes with updates to the Swift language including generics improvement, and standard library updates. Swift 4.2 also comprises changes to the package manager.

Swift is a general-purpose and multi-paradigm programming language developed by Apple Inc. for iOS, macOS, watchOS, tvOS, and Linux. Swift is built for uses that range from systems programming to mobile and desktop apps, to scaling up to cloud services.

Let’s have a look at the key features in Swift 4.2.

Language updates

Swift 4.2 is a major language release and comprises of language changes such as Generics improvements, and Standard library updates.

Generics Improvement

Better support has been added for Generics which ultimately makes more of your code reusable.

Standard Library updates

The standard library in this latest release consists of a number of new features such as improvements to the Hashable protocol and a new unified set of randomization functions and protocols.

Other updates

Swift 4.2 has enabled the binary compatibility for future releases of Swift. Support has been added for batch mode compilation that results in faster build times. There’s a change in calling convention for retain/release cycle which helps reduce the code size and improve runtime performance.

Package Manager Updates

Swift 4.2 explores three new features namely, batch mode support, improved scheme generation logic, and automatic Xcode project generation.

With Swift 4.2, the swift targets will be now compiled using the Swift compiler’s batch mode The scheme generation logic has been improved and it generates the following schemes:

  • One scheme comprising all regular and test targets of the root package.
  • One scheme per executable target consisting of the test targets whose dependencies intersect with the dependencies of the executable target.

Swift 4.2 offers automatic Xcode project generation. The generate-xcodeproj here has a new –watch option which enables it to watch the file system and regenerate the Xcode project automatically, if needed.

For more information on this release, check out the official release notes.

Read Next

Your First Swift Program

What’s new in Vapor 3, the popular Swift based web framework

Swift’s Core Libraries

Natasha Mathur

Tech writer at the Packt Hub. Dreamer, book nerd, lover of scented candles, karaoke, and Gilmore Girls.

Share
Published by
Natasha Mathur

Recent Posts

Top life hacks for prepping for your IT certification exam

I remember deciding to pursue my first IT certification, the CompTIA A+. I had signed…

3 years ago

Learn Transformers for Natural Language Processing with Denis Rothman

Key takeaways The transformer architecture has proved to be revolutionary in outperforming the classical RNN…

3 years ago

Learning Essential Linux Commands for Navigating the Shell Effectively

Once we learn how to deploy an Ubuntu server, how to manage users, and how…

3 years ago

Clean Coding in Python with Mariano Anaya

Key-takeaways:   Clean code isn’t just a nice thing to have or a luxury in software projects; it's a necessity. If we…

3 years ago

Exploring Forms in Angular – types, benefits and differences   

While developing a web application, or setting dynamic pages and meta tags we need to deal with…

3 years ago

Gain Practical Expertise with the Latest Edition of Software Architecture with C# 9 and .NET 5

Software architecture is one of the most discussed topics in the software industry today, and…

3 years ago