Concurrency fixes for Swift 6 #8
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note
Work is based on source branch of #7 so merge that before
but since I'm creating PRs from my fork I cannot select that source branch (my fork) as target branch here
to get proper git diff. I.e. if/after #7 is merged we can see proper diff.
Minor updates the Swift SDK and some updates to the Demo app so that it compiles and runs in Swift Language Version: 6 with strict concurrency fixes.
Note
This is mostly a patch, both the SDK and the Demo app would really benefit from a larger refactoring (drop usage of classes in favour of structs for dependencies like API clients, and be implemented using swift-dependencies for testability and safe sendability)
Also made functions ought to be made throwing with at least some crude error handling and force unwrap ought to be
removed (demo app crashes if no server is running).
Changes
SWIFT_STRICT_CONCURRENCY = complete;andSWIFT_VERSION = 6.0;this is not a full migration/upgrade, this fix is a patch relying on@unchecked Sendable.@ObservedObjectproperties, sinceUserConfigandMyBusinessLogicclasses have been upgraded to use Observation frameworkss macro@Observablevartolet- in Swift a property need not bevarif the type is a class, not for mutation of values inside said property.@Bindingcan be used (e.g.DelegatedLoginViewhold a@Binding var userConfig: UserConfigsince the view need to be able to write to theemailofuserConfig, else we can just pass the type as a reference without@Bindingproperty wrapperMyBusinessLogic,MyServerto@MainActorin demoPasskeysSignerin SDK to@MainActorDemo
I'm running a node server as per and using
ngrokand the code works in Simulator on Xcode 26.1Simulator.Screen.Recording.-.iPhone.17.Pro.-.2025-11-23.at.11.39.36.mov