Skip to content

fix: address Swift 6 concurrency diagnostics#77

Open
brientim wants to merge 11 commits into
spacenation:mainfrom
brientim:fix/swift-6_3-concurrency
Open

fix: address Swift 6 concurrency diagnostics#77
brientim wants to merge 11 commits into
spacenation:mainfrom
brientim:fix/swift-6_3-concurrency

Conversation

@brientim

Copy link
Copy Markdown

Summary

  • mark option/config value types as Sendable (PointSliderOptions, RangeSliderOptions, ValueSliderOptions, and track config structs)
  • mark default style environment key values as nonisolated(unsafe) for Any*SliderStyle defaults so Swift 6 does not treat them as unsafe mutable shared globals

Reproduction

In a Swift 6 consumer build, package compilation fails with concurrency-safety diagnostics such as:

  • static property 'defaultValue' is not concurrency-safe because non-'Sendable' type ...
  • static property ... is not concurrency-safe because non-'Sendable' type ...

Verification

  • swift build
  • verified from a real iOS consumer app (ControlZ) that the previous swiftui-sliders Swift 6 concurrency errors are removed when pinned to this branch

Made with Cursor

brientim added 11 commits April 29, 2026 17:27
Mark slider option/config value types as Sendable and annotate environment default style keys as nonisolated(unsafe) to satisfy Swift 6 concurrency checks for static defaults.

Made-with: Cursor
Use @preconcurrency SwiftUI imports for horizontal/vertical value slider style files to avoid strict Swift 6 sendability diagnostics introduced by newer SDK gesture APIs.

Made-with: Cursor
Use @preconcurrency SwiftUI import in rectangular point slider style to avoid Swift 6 gesture sendability isolation regressions with newer SDKs.

Made-with: Cursor
Use @preconcurrency SwiftUI imports in horizontal/vertical range slider style files to avoid Swift 6 gesture sendability isolation regressions.

Made-with: Cursor
Annotate value slider style declarations with @preconcurrency to prevent Swift 6 sendability diagnostics on DragGesture callback closures when consumed under strict concurrency.

Made-with: Cursor
Annotate range slider style declarations with @preconcurrency so strict Swift 6 consumer builds do not fail on DragGesture callback sendability diagnostics.

Made-with: Cursor
Disable the interactive-track DragGesture.onChanged path under Swift 6 to avoid strict concurrency sendability diagnostics, while preserving thumb drag interaction.

Made-with: Cursor
Split thumb rendering by Swift version and disable thumb DragGesture callbacks in Swift 6 builds to avoid strict sendability diagnostics while keeping older behavior on Swift 5 toolchains.

Made-with: Cursor
Disable interactive-track DragGesture callback path in Swift 6 builds to avoid strict sendability diagnostics in newer SDKs.

Made-with: Cursor
Disable range thumb DragGesture callback paths under Swift 6 to avoid strict sendability diagnostics in newer SDKs while retaining Swift 5 behavior.

Made-with: Cursor
Disable rectangular thumb DragGesture callback path under Swift 6 to avoid strict sendability diagnostics with newer SDKs.

Made-with: Cursor
@brientim

Copy link
Copy Markdown
Author

@spacenation is this going to be reviewed, or should I abandon the PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant