What should the Concurrency Settings be for a brand new project?

If you enable Swift 6 language mode, strict ("complete") concurrency checking is enabled by default as are most of the concurrency related upcoming features.
The exceptions are InferIsolatedConformances and NonisolatedNonsendingByDefault which were released with Swift 6.2 and so won't be enabled by default until Swift 7.

If you enable "Approachable Concurrency" in Xcode, then these two upcoming features are also enabled for you.

So for your package to match your Xcode configuration, you will want to enable Swift 6 mode, and then enable these two upcoming features.
"nonisolated" default actor isolation is the default, so you don't need to enable that explicitly.

"Default Internal Imports", "Member Import Visibility" and "Require Existential any" are not concurrency related. They will likely become enabled by default in a future language mode though so for an entirely new project you can consider enabling them too so you don't need to migrate later. But leaving them disabled is entirely fine too.


As for what the older concurrency upcoming features do, I'll refer you to this series by Matt Massicotte that describes the related proposals leading up to Swift 6. And then see this post of his for Swift 6.1 changes.

InferIsolatedConformances adds the ability to for a type to conform to a protocol in a way where that conformance can only be used on a specific global actor (like MainActor). There is no reason not to want to enable that feature, it is only disabled by default because there is a small chance of a source incompatibility with existing code which can require some minor source changes.

NonisolatedNonsendingByDefault on the other hand significantly changes the semantics of existing code. But for a new project it's a good idea to enable this from the start as it will become the default in the future. In addition to the evolution proposal, the Swift documentation contains a short guide to it and how you can have Swift migrate existing code.

For both of these you should be able to find various recent articles that explain these in detail so I won't try to describe them in full here myself.
But if you have specific questions about these or any of the older upcoming features, feel free to ask!

9 Likes