Version Compatibility

日本語を消す 英語を消す

下記URLから引用し、日本語訳をつけてみました。

https://docs.swift.org/swift-book/documentation/the-swift-programming-language/compatibility

Learn what functionality is available in older language modes.

くまメモ

2024/6/11現在Apple StoreからダウンロードできるXcodeのバージョンは15です。SwiftのXcode15の対応バージョンはSwift5.10です。

This book describes Swift 6, the default version of Swift that’s included in Xcode 16. You can use the Swift 6 compiler to build code that’s written in Swift 6, Swift 5, Swift 4.2, or Swift 4.

When you use the Swift 6 compiler to build code that uses the Swift 5 language mode, you can use the new features from Swift 6 — they’re enabled either by default or by an upcoming feature flag. However, to enable strict concurrency checking, you need to upgrade to the Swift 6 language mode.

In addition, when you use Xcode 15.3 to build Swift 4 and Swift 4.2 code, most Swift 5 functionality is still available. That said, the following changes are available only to code that uses the Swift 5 language mode:

  • Functions that return an opaque type require the Swift 5.1 runtime.
  • The try? expression doesn’t introduce an extra level of optionality to expressions that already return optionals.
  • Large integer literal initialization expressions are inferred to be of the correct integer type. For example, UInt64(0xffff_ffff_ffff_ffff) evaluates to the correct value rather than overflowing.

Concurrency requires the Swift 5 language mode and a version of the Swift standard library that provides the corresponding concurrency types. On Apple platforms, set a deployment target of at least iOS 13, macOS 10.15, tvOS 13, or watchOS 6.

A target written in Swift 6 can depend on a target that’s written in Swift 5, Swift 4.2 or Swift 4, and vice versa. This means, if you have a large project that’s divided into multiple frameworks, you can migrate your code to a newer language version one framework at a time.

Beta Software

This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.

このドキュメントには、開発中の API またはテクノロジに関する予備的な情報が含まれています。この情報は変更される可能性があり、このドキュメントに従って実装されたソフトウェアは、最終的なオペレーティング システム ソフトウェアでテストする必要があります。

Learn more about using Apple’s beta software(link:developer.apple.com).

Apple’s beta software(link:developer.apple.com)(英語)の使用について詳しくは、こちらをご覧ください。