What’s new in Apple’s Swift 4.0 language

What’s new in Apple’s Swift 4.0 language

Swift 4.0 is now available. It's a major upgrade to Apple’s Swift, the three-year old successor to the Objective-C language used for MacOS and iOS application development.

The Swift 4 upgrade enhances the Swift Package Manager and provides new compatibility modes for developers. Apple said Swift 4 also makes Swift more stable and improves its standard library. Swift 4 is largely source-compatible with Swift 3 and ships as part of Apple's Xcode 9 IDE.

 

What’s new in Swift 4’s package manager

Swift Package Manager, which debuted in Swift 3, is tool for distributing code. It is integrated with the Swift build system to automate processes including downloading, compiling, and linking of dependencies. Improvements in Swift 4’s package manager include:

  • A cleaner Package API that allows packages to specify new settings. These settings give developers more control over the building of packages and organization of sources on disk.
  • Development of multiple packages in tandem has been made easier.
  • Formalization of package products, enabling control over what libraries a package publishes to clients.
  • Package builds on MacOS now occur in a sandbox, preventing network access and file-system modification, to reduce the reach of malicious manifests.

 

New compatibility modes in Swift 4 aid migration

Swift 4’s new compatibility modes could save you from having to modify code to be able to use the new version of the compiler. Two modes are supported, including the Swift 3.2 mode, which accepts most source files built with Swift 3.x compilers, and the Swift 4.0 mode, which includes Swift 4 and API changes.

Apple said that some source migration will be needed for many projects, but the number of source changes are “quite modest” compared to many previous major changes between Swift releases. The introduction of the compatibility modes in Swift 4 gives developers more control over the pace of migration.

To continue reading...


Please login or register to view your article. If you do not have or do not remember your password, please click on the “Forgotten your password?” link at the bottom.
If you do not yet have a password but are an existing user, please use the “Forgotten your password?

PREVIOUS ARTICLE

«AppleCare+: Everything you need to know about Apple’s extended warranty program

NEXT ARTICLE

HTC Vive vs. Oculus Rift vs. Windows Mixed Reality: What's the difference?»
author_image
IDG Connect

IDG Connect tackles the tech stories that matter to you

Add Your Comment

Most Recent Comments

Our Case Studies

IDG Connect delivers full creative solutions to meet all your demand generatlon needs. These cover the full scope of options, from customized content and lead delivery through to fully integrated campaigns.

images

Our Marketing Research

Our in-house analyst and editorial team create a range of insights for the global marketing community. These look at IT buying preferences, the latest soclal media trends and other zeitgeist topics.

images

Poll

Will Kotlin overtake Java as the most popular Android programming language in 2018?