HomeiOS DevelopmentEnabling Concurrency warnings in Xcode 15 – Donny Wals

Enabling Concurrency warnings in Xcode 15 – Donny Wals


If you wish to make it possible for your code adopts Swift concurrency as accurately as potential in Swift 5.9, it is a good suggestion to allow the Strict Concurrency Checking (SWIFT_STRICT_CONCURRENCY) flag in your challenge.

To do that, choose your challenge’s goal and navigate to the Construct Settings tab. Ensure you choose All from the record of settings that’s proven (Fundamental is the default) and kind Strict Concurrency within the searchbar to search out the Strict Concurrency Checking construct setting.

The screenshot under exhibits all of the related elements so that you can see:

Enabling Concurrency warnings in Xcode 15 – Donny Wals

The default worth for this setting is Minimal which boils all the way down to the Compiler solely checking specific Sendable annotations amongst different issues. This setting is the least restrictive and enforces as little of Swift Concurrency’s constraints as potential in the interim.

You’ll be able to bump your checking to Focused which can implement Sendable and actor-isolation checks in your code, and it’ll explicitly very that Sendable constraints are met once you mark one in all your varieties as Sendable. This mode is actually a little bit of a hybrid between the conduct that is meant in Swift 6, and what’s allowed now. You should use this mode to have a little bit of checking in your code that makes use of Swift Concurrency with out an excessive amount of warnings and / or errors in your present codebase.

With Full you’ll get the complete suite of concurrency constraints, basically as they’ll work in Swift 6. Personally I might suggest enabling this setting for brand new initiatives the place you need all your code to be correctly checked instantly. In an present codebase this mode is perhaps somewhat too strict, however however it is going to flag a lot of issues that can be necessary in Swift 6.

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments