• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Home
  • About Us
  • Contact Us

iHash

News and How to's

  • Prodigy Afterschool Masterclasses for Kids for $99

    Prodigy Afterschool Masterclasses for Kids for $99
  • 10.1" WiFi Digital Photo Frame with Photo/Video Sharing for $149

    10.1" WiFi Digital Photo Frame with Photo/Video Sharing for $149
  • 8" WiFi Cloud Photo Frame for $112

    8" WiFi Cloud Photo Frame for $112
  • 8" WiFi Digital Photo Frame with Auto Rotation & Photo/Video Sharing for $112

    8" WiFi Digital Photo Frame with Auto Rotation & Photo/Video Sharing for $112
  • Wireless Wall Tap Smart Plug for $39

    Wireless Wall Tap Smart Plug for $39
  • News
    • Rumor
    • Design
    • Concept
    • WWDC
    • Security
    • BigData
  • Apps
    • Free Apps
    • OS X
    • iOS
    • iTunes
      • Music
      • Movie
      • Books
  • How to
    • OS X
      • OS X Mavericks
      • OS X Yosemite
      • Where Download OS X 10.9 Mavericks
    • iOS
      • iOS 7
      • iOS 8
      • iPhone Firmware
      • iPad Firmware
      • iPod touch
      • AppleTV Firmware
      • Where Download iOS 7 Beta
      • Jailbreak News
      • iOS 8 Beta/GM Download Links (mega links) and How to Upgrade
      • iPhone Recovery Mode
      • iPhone DFU Mode
      • How to Upgrade iOS 6 to iOS 7
      • How To Downgrade From iOS 7 Beta to iOS 6
    • Other
      • Disable Apple Remote Control
      • Pair Apple Remote Control
      • Unpair Apple Remote Control
  • Special Offers
  • Contact us

Swift 5.6 Released!

Mar 14, 2022 by iHash Leave a Comment

Swift 5.6 is now officially released!

Thank you to everyone in the Swift community for your discussion, proposals, bug reports, pull requests, and more.

Swift 5.6 includes a number of enhancements to the type system, improved interaction with pointers, and adds the ability to run new plugin commands using the package manager.

For a quick dive into some of what’s new in Swift 5.6, check out this playground put together by Paul Hudson.

If you’re new to Swift, The Swift Programming Language is the definitive guide on the Swift programming language and has been updated for version 5.6. The Swift community also maintains a number of translations. It is also available for free on the Apple Books store.

Table of Contents

  • Language and Standard Library
    • New Features and Refinements
    • Enhancements to the Type System
      • Type Placeholders (SE-0315)
      • Existential any (SE-0335)
    • Improved Interaction with Pointers
      • Temporary uninitialized buffers (SE-0322)
      • Relax diagnostics for pointer arguments to C functions (SE-0324)
      • Remove Sendable conformance from unsafe pointer types (SE-0331)
    • Improved Concurrency Safety Model
      • Sendable and @Sendable closures (SE-0302)
      • Incremental migration to concurrency checking (SE-0337)
  • Ecosystem
    • Swift Package Manager
      • Extensible Build Tools (SE-0303)
      • Command Plugins (SE-0332)
    • Swift-DocC Updates
  • Downloads

Language and Standard Library

New Features and Refinements

Swift 5.6 enhances the language through a number of proposals from the Swift Evolution process, including:

  • SE-0290 – Unavailability Condition
  • SE-0302 – Sendable and @Sendable closures
  • SE-0315 – Type placeholders (formerly, “Placeholder types”)
  • SE-0320 – Allow coding of non String / Int keyed Dictionary into a KeyedContainer
  • SE-0322 – Temporary uninitialized buffers
  • SE-0324 – Relax diagnostics for pointer arguments to C functions
  • SE-0331 – Remove Sendable conformance from unsafe pointer types
  • SE-0335 – Introduces existential any
  • SE-0337 – Incremental migration to concurrency checking

Let’s take a closer look at some of these below.

Enhancements to the Type System

Type Placeholders (SE-0315)

Swift allows you to omit verbose, incidental details from your code using type inference. However, writing explicit types when needed can feel excessive because you have to specify a complete type, even when your code only needed a specific part of the type to provide clarity:

enum Either<Left, Right> {
  case left(Left)
  case right(Right)
}

let either: Either<ClosedRange<Int>, Range<Int>> = .left(0...10)

With type placeholders, you can now write partial type annotations in your code to provide only the details that were necessary. A type placeholder is written with _, and it directs the compiler to infer the missing type:

enum Either<Left, Right> {
  case left(Left)
  case right(Right)
}

// Inferred as 'Either<ClosedRange<Int>, Range<Int>>'
let either: Either<_, Range<Int>> = .left(0...10)

Existential any (SE-0335)

Existential types in Swift are used to store a value of any type conforming to a specific protocol. Today, existential types are spelled using a plain protocol name or protocol composition:

protocol DataSourceObserver { ... }

struct DataSource {
  var observers: [DataSourceObserver] { ... }
}

An existential type erases its underlying type information, which is useful when you need to dynamically change the underlying type, but it prohibits existential types from other useful capabilities such as conforming to protocols. The existing syntax is confusing because an existential type looks just like a generic conformance requirement, which doesn’t have these fundamental limitations.

In Swift 5.6, existential types can be explicitly marked with the any keyword:

protocol DataSourceObserver { ... }

struct DataSource {
  var observers: [any DataSourceObserver] { ... }
}

Improved Interaction with Pointers

Swift 5.6 introduces three significant improvements when working with unsafe pointers:

Temporary uninitialized buffers (SE-0322)

This introduces a new way to create temporary uninitialized memory space, which is particularly useful when interacting with C APIs that need to be supplied with memory into which to store results of a computation.

Relax diagnostics for pointer arguments to C functions (SE-0324)

This change allows the passing of mutable variants of unsafe pointers (e.g. UnsafeMutablePointer) to APIs that take the immutable version (e.g. UnsafePointer) without an explicit conversion.

Remove Sendable conformance from unsafe pointer types (SE-0331)

Feedback from early adoption of Sendable shows that pointer conformance has unexpected negative consequences, especially for implicit conformance, since these types behave like references.

Improved Concurrency Safety Model

Swift 5.6 also includes several improvements to the concurrency safety model:

Sendable and @Sendable closures (SE-0302)

Structural types such as @Sendable function types, tuples consisting of Sendable type (including Void), and metatypes (like Any.Type) now conform to the Sendable protocol. The Task and task-local APIs now define Sendable constraints as necessary.

Incremental migration to concurrency checking (SE-0337)

Diagnostics about Sendable are suppressed by default in Swift 5.6, but can be enabled by explicitly defining conformances to Sendable or using the -warn-concurrency compiler flag, enabling an incremental migration path to concurrency checking.

Ecosystem

Swift Package Manager

The Swift Package Manager gained extensibility features in Swift 5.6, alongside several important security, performance and reliability updates.

Extensible Build Tools (SE-0303)

Introduces the ability to define build tool plugins in SwiftPM, allowing custom tools to be automatically invoked during a build. Build tool plugins are focused on code generation during the build of a package, for such purposes as generating Swift source files from .proto files or from other inputs, in order to allow build tools to be incorporated into the build graph and to run automatically in a safe manner.

Command Plugins (SE-0332)

Extends SwiftPM plugin support first introduced with SE-0303 to allow the definition of custom command plugins — plugins that users can invoke directly from the SwiftPM CLI, or from an IDE that supports Swift Packages, in order to perform custom actions on their packages. A command plugin specifies the semantic intent of the command — this might be one of the predefined intents such “documentation generation” or “source code formatting”, or it might be a custom intent with a specialized verb that can be passed to the swift package command.

Other updates include:

  • SE-0305 – Package Manager Binary Target Improvements
  • Semantic version dependencies can now be resolved against Git tag names that contain only major and minor version identifiers. A tag with the form X.Y will be treated as X.Y.0. This improves compatibility with existing repositories.
  • To increase the security of packages, SwiftPM performs trust on first use (TOFU) validation. The fingerprint of a package is now being recorded when the package is first downloaded from a Git repository. Subsequent downloads must have fingerpints matching previous recorded values, otherwise it would result in build warnings or failures depending on settings.
  • Multiple improvements to dependencies resolution infrastructure, leading to improved performance and reliability of dependency resolution

Swift-DocC Updates

Swift-DocC is now available as a SwiftPM plugin using the new plugin command support. See the documentation to learn how to get started.

In addition, you can now use Swift-DocC to publish static content to GitHub Pages.

Other enhancements include:

  • The docc command-line tool is now a part of the open-source, release Swift toolchain for macOS and Linux platforms.
  • Swift-DocC can now build documentation that is compatible with static hosting environments, like GitHub Pages.
  • Swift-DocC can now produce documentation for executable targets like command-line tools and apps.

Be sure to check out Joseph Heck’s great blog post covering this is in more detail.

Downloads

Official binaries are available for download from Swift.org for Xcode, Windows, and Linux. Swift 5.6 is also included in Xcode 13.3.

We also provide RPMs for Amazon Linux 2 and CentOS 7 for experimental use only. Please provide your feedback.

Use the instructions below for RPM installation:

Amazon Linux 2

$ curl https://download.swift.org/experimental-use-only/repo/amazonlinux/releases/2/swiftlang.repo > /etc/yum.repos.d/swiftlang.repo
$ amazon-linux-extras install epel
$ yum install swiftlang

CentOS 7

$ curl https://download.swift.org/experimental-use-only/repo/centos/releases/7/swiftlang.repo > /etc/yum.repos.d/swiftlang.repo
$ yum install epel-release
$ yum install swiftlang

Swift 5.6 Released!

Share this:

  • Facebook
  • Twitter
  • Pinterest
  • LinkedIn

Filed Under: News Tagged With: Apple

Special Offers

  • Prodigy Afterschool Masterclasses for Kids for $99

    Prodigy Afterschool Masterclasses for Kids for $99
  • 10.1" WiFi Digital Photo Frame with Photo/Video Sharing for $149

    10.1" WiFi Digital Photo Frame with Photo/Video Sharing for $149
  • 8" WiFi Cloud Photo Frame for $112

    8" WiFi Cloud Photo Frame for $112
  • 8" WiFi Digital Photo Frame with Auto Rotation & Photo/Video Sharing for $112

    8" WiFi Digital Photo Frame with Auto Rotation & Photo/Video Sharing for $112
  • Wireless Wall Tap Smart Plug for $39

    Wireless Wall Tap Smart Plug for $39

Reader Interactions

Leave a Reply Cancel reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

E-mail Newsletter

  • Facebook
  • GitHub
  • Instagram
  • Pinterest
  • Twitter
  • YouTube

More to See

insideBIGDATA Latest News – 6/27/2022

Jun 27, 2022 By iHash

Cybersecurity Experts Warn of Emerging Threat of “Black Basta” Ransomware

Jun 27, 2022 By iHash

Tags

* Apple Cisco computer security cyber attacks cyber crime cyber news Cyber Security cybersecurity cyber security news cyber security news today cyber security updates cyber threats cyber updates data breach data breaches google hacker hacker news Hackers hacking hacking news how to hack incident response information security iOS iOS 7 iOS 8 iPhone iPhone 6 Malware microsoft network security Privacy ransomware malware risk management security security breaches security vulnerabilities software vulnerability the hacker news Threat update video web applications

Latest

Prodigy Afterschool Masterclasses for Kids for $99

Expires June 28, 2122 23:59 PST Buy now and get 85% off KEY FEATURES Unlock Your Child’s Potential For Success! No dream is too big when you have the tools to achieve it. Whether your child dreams of saving lives as a doctor or inspiring people through the arts, Prodigy will give them the tools […]

10.1" WiFi Digital Photo Frame with Photo/Video Sharing for $149

Expires June 25, 2122 23:59 PST Buy now and get 6% off KEY FEATURES Send Pictures and Videos from your smartphone to eco4life WiFi Digital Photo Frame, from anywhere in the world using the eco4life App. The eco4life smart frame is simply the best way to enjoy your favorite photos and videos with your families […]

Charlie Klein

Key-Thoughts on Cross-Organizational Observability Strategy

Logz.io ran two surveys earlier this year to better understand current trends, challenges, and strategies for implementing more effective and efficient observability – including the DevOps Pulse Survey and a survey we ran with Forrester Research. Together, we received responses from 1300+ DevOps and IT Ops practitioners on observability challenges, opportunities, and ownership strategies. Additionally, […]

Wi-Fi 1080p Indoor 360° View PTZ IP Camera for $57

Expires June 25, 2122 23:59 PST Buy now and get 17% off KEY FEATURES Experience the flexibility and power of 7/24 all-day recording with this 360° PTZ IP Camera. It shows you live videos on your phone in 1920×1080 full HD resolution, day or night. It’s also packed with two-way audio, advanced night vision, and […]

Survey Results Identifying the Benefits and Challenges of RPA

Robocorp, a top provider of Gen2 robotic process automation (RPA), announced the results of their State of RPA survey, which was designed to understand the challenges users face with current RPA solutions. The results will help usher in the next generation of enterprise automation – Gen2 RPA. Conducted online in May 2022, The State of […]

How is IoT Changing the Future of Cruising?

In this special guest feature, Ian Richardson, CEO & Co-Founder, theICEway, discusses how as the world continues to open for travel, cruise industry leaders are looking to leverage the next wave of travel technology to improve the passenger experience. With 20+ years of experience in both IT and the cruise industry, Ian Richardson co-founded theICEway […]

Jailbreak

Pangu Releases Updated Jailbreak of iOS 9 Pangu9 v1.2.0

Pangu has updated its jailbreak utility for iOS 9.0 to 9.0.2 with a fix for the manage storage bug and the latest version of Cydia. Change log V1.2.0 (2015-10-27) 1. Bundle latest Cydia with new Patcyh which fixed failure to open url scheme in MobileSafari 2. Fixed the bug that “preferences -> Storage&iCloud Usage -> […]

Apple Blocks Pangu Jailbreak Exploits With Release of iOS 9.1

Apple has blocked exploits used by the Pangu Jailbreak with the release of iOS 9.1. Pangu was able to jailbreak iOS 9.0 to 9.0.2; however, in Apple’s document on the security content of iOS 9.1, PanguTeam is credited with discovering two vulnerabilities that have been patched.

Pangu Releases Updated Jailbreak of iOS 9 Pangu9 v1.1.0

  Pangu has released an update to its jailbreak utility for iOS 9 that improves its reliability and success rate.   Change log V1.1.0 (2015-10-21) 1. Improve the success rate and reliability of jailbreak program for 64bit devices 2. Optimize backup process and improve jailbreak speed, and fix an issue that leads to fail to […]

Activator 1.9.6 Released With Support for iOS 9, 3D Touch

  Ryan Petrich has released Activator 1.9.6, an update to the centralized gesture, button, and shortcut manager, that brings support for iOS 9 and 3D Touch.

Copyright iHash.eu © 2022
We use cookies on this website. By using this site, you agree that we may store and access cookies on your device. Accept Read More
Privacy & Cookies Policy

Privacy Overview

This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary
Always Enabled
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Non-necessary
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.
SAVE & ACCEPT