Swift strict concurrency

Asked on 05/12/2025

1 search

Swift strict concurrency is a feature introduced to enhance data race safety in Swift applications. At WWDC 2024, it was discussed in the session titled "Migrate your app to Swift 6." The session explains how enabling strict concurrency checking in Swift 6 can help identify potential race conditions in your code. This is done by setting the concurrency checking to "complete checking" in your project's build settings, which causes the compiler to emit warnings for code that may not be concurrency safe. This feature is particularly useful when working with modules that haven't been updated for Swift concurrency, such as C libraries or older Swift frameworks.

In Swift 6, data race safety is achieved by default, turning potential data race issues into compile-time errors, which significantly improves the security and reliability of your app. This is part of the broader effort to make Swift a safer language for concurrent programming by using mechanisms like actors for protecting mutable state and the Sendable protocol for safe data sharing.

For more detailed information, you can refer to the session Migrate your app to Swift 6 (11:05) where enabling complete checking in the watch extension is discussed.