Version Compatibility バージョン互換性

This book describes Swift 5.6, the default version of Swift that’s included in Xcode 13. You can use Xcode 13 to build targets that are written in either Swift 5.6, Swift 4.2, or Swift 4. この本はSwift 5.6、Xcode 13に含まれるスウィフトの初期状態のバージョン、を記述します。あなたは、Xcode 13を使ってSwift 5.6、Swift 4.2、またはSwift 4のいずれかで書かれたターゲットをビルドできます。

When you use Xcode 13 to build Swift 4 and Swift 4.2 code, most Swift 5.6 functionality is available. That said, the following changes are available only to code that uses Swift 5.6 or later: あなたがXcode 13を使ってSwift 4とSwift 4.2コードをビルドする場合、ほとんどのSwift 5.6機能性が利用可能です。とはいえ、以下の変更はSwift 5.6以降を使用するコードでのみ利用可能です:

  • Functions that return an opaque type require the Swift 5.1 runtime. 不透明型を返す関数は、Swift 5.1ランタイムを必要とします。
  • The try? expression doesn’t introduce an extra level of optionality to expressions that already return optionals. try?式は、既にオプショナルを返す式に、余分な水準の随意性を導入しません。
  • 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. 大きな整数リテラル初期化式は、正しい整数型のものであるように推論されます。例えば、UInt64(0xffff_ffff_ffff_ffff)は正しい値に評価されます、オーバーフローするのではなくて。

Concurrency requires Swift 5.6 or later, 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 15, macOS 12, tvOS 15, or watchOS 8.0. 並行性はSwift 5.6以降、および対応している並行性型を提供するSwift標準ライブラリのあるバージョンを必要とします。Appleプラットホームでは、少なくともiOS 15、macOS 12、tvOS 15、またはwatchOS 8.0の開発ターゲットを設定してください。

A target written in Swift 5.6 can depend on a target that’s written in 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 from Swift 4 to Swift 5.6 one framework at a time. Swift 5.6で記述されるターゲットは、Swift 4.2またはSwift 4で記述されるターゲットを頼りにできます、そして逆も同じです。これは、あなたが複数のフレームワークへと分割される巨大なプロジェクトを持つならば、あなたはあなたのコードをSwift 4からSwift 5.6へと一度に1フレームワークずつ移行できるのを意味します。

About Swift スウィフトについて

A Swift Tour スウィフトツアー