AWESOME: Test Collection

What’s new in Apple’s Swift 4.2 language

The programming language for MacOS and iOS apps offers an improved package manager, new source-code compatibility option, and many language improvements

Become An Insider

Sign up now and get FREE access to hundreds of Insider articles, guides, reviews, interviews, blogs, and other premium content. Learn more.

Ahead of the planned 2019 release of Swift 5, Apple has released the intermediate Swift 4.2 version.

Current version: What’s new in Apple’s Swift 4.2

Version 4.2 of Apple’s Swift programming language brings the language closer to a stabilized application binary interface (ABI) and enables binary compatibility for future releases. ABI stability enables binary compatibility between libraries and applications compiled with different versions of the language.

Although Apple’s goal is stability, Swift 4.2 is not binary-compatible with previous releases. Source compatibility, however, is provided. Most source code built with the Swift 4.0 compiler should compile with both the Swift 4.2 and Swift 4.1 compilers.

Other new features in Swift 4.2 are:

  • Generics improvements, anchored by the completion of conditional conformance support, reducing the amount of boilerplate code and making more code reusable.
  • Standard library features include improvements to the Hashable protocol and a unified set of randomization functions and protocols.
  • Batch-mode compilation support, which improves build times.
  • A change in the calling convention for the retain/release cycle, to reduce code size and improve performance.
  • Recursive metadata support.
  • More-compact reflection metadata.
  • Deflection arguments inlined at call sites.
  • Various bug fixes, such as for inheritance of generic initializers.
  • The compiler directive that is syntactically equivalent to the #if swift version check but checks against the version of the compiler, regardless of which compatibility mode is running.
  • New Swift package manager capabilities, including support for batch mode, with targets now compiled using this mode; improved scheme generation logic; and automatic Xcode project generation.

To continue reading this article register now

  
Shop Tech Products at Amazon