What’s New in Swift 4.0

Swift Language was introduced by Apple in 2014 Worldwide Developers Conference with intending to support many core concepts associated with Objective C. Last year in March Swift made up in the monthly TIOBE Index of top 10 popular programming languages.

Swift 4.0 was launched in September 2017 with improvements. Swift 4.0 announced with many Language Improvements, the New Source-code Compatibility, and an Improved Package Manager.

Swift 4.0 having many Language Improvements, like

  • Removed final keyword from function declaration in protocol extensions and given more power to an interaction between private declarations and extensions, with private access control.
  • Provided compatibility to where clauses to constrain associated types and type-safe serialization to JSON and Protocol oriented integers.
  • Improved management of collection types and providing memory safety in exclusive access to memory.
  • Now onwards string implementation is faster and easier-to-use with retaining of Unicode correctness and providing the capability of archiving enum and struct types.
  • Also, added a new swift run command to build and run an executable.

A New Source Code  Compatibility, Compatibility modes of Swift 4.0 gives more control and faster access to code migration and it could save developer’s time to modify the code to be able to use for the new version of the compiler.

An Improved Package Manager, Swift package manager was introduced with Swift 3.0, to automate processes including downloading, linking, and compiling dependencies. Given more power to the developer over the building of packages and organization of sources on disk. Enabled sandboxing of the package builds on MacOS to prevent the unauthorized access. And also provided the interpretation of package products.

About the Author: