Skip to content

Added support for Swift 6 / Strict Concurrency - #437

Open
SomeRandomiOSDev wants to merge 2 commits into
devicekit:masterfrom
SomeRandomiOSDev:somerandomiosdev/strict-concurrency
Open

Added support for Swift 6 / Strict Concurrency#437
SomeRandomiOSDev wants to merge 2 commits into
devicekit:masterfrom
SomeRandomiOSDev:somerandomiosdev/strict-concurrency

Conversation

@SomeRandomiOSDev

Copy link
Copy Markdown
Contributor

This PR adds support for Swift 6 as well as enables strict concurrency in the project.

Appropriate annotations have been added to properties/method that access actor-isolated APIs and Sendable conformances have been added to types provided by the library (e.g. Device, Device.BatterState, etc.)

Comment threadSource/Device.generated.swift Outdated
Comment threadSource/Device.swift.gyb Outdated
@Zandor300
Zandor300force-pushed the somerandomiosdev/strict-concurrency branch from 51ef2f2 to bbfd0f8CompareMarch 20, 2025 09:34
@gabors

Copy link
Copy Markdown

@SomeRandomiOSDev Why all the @MainActor annotations?

@SomeRandomiOSDev

Copy link
Copy Markdown
ContributorAuthor

@SomeRandomiOSDev Why all the @MainActor annotations?

@gabors The annotations are due to the fact that UIDevice itself is restricted to the @MainActor, meaning that any API that uses it must also be annotated as such. WatchKit’s equivalent WKInterfaceDevice has no such restriction, hence all of the #if declarations

@Kaspik

Copy link
Copy Markdown

@Zandor300 Can we merge this and make a Swift 6 compatible release soon? Swift 6 is becoming a real thing and Swift concurrency is important already.

@SomeRandomiOSDev

Copy link
Copy Markdown
ContributorAuthor

@Zandor300 Could we get a review and potential merge of this?

@markst

Copy link
Copy Markdown

Bump 😅

Sign up for freeto 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.

5 participants

@SomeRandomiOSDev@gabors@Kaspik@markst@Zandor300