DeviceKit icon indicating copy to clipboard operation
DeviceKit copied to clipboard

Added support for Swift 6 / Strict Concurrency

Open SomeRandomiOSDev opened this issue 11 months ago • 4 comments

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.)

SomeRandomiOSDev avatar Mar 12 '25 14:03 SomeRandomiOSDev

@SomeRandomiOSDev Why all the @MainActor annotations?

gabors avatar Mar 20 '25 18:03 gabors

@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

SomeRandomiOSDev avatar Mar 21 '25 11:03 SomeRandomiOSDev

@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.

Kaspik avatar May 28 '25 16:05 Kaspik

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

SomeRandomiOSDev avatar Jul 11 '25 14:07 SomeRandomiOSDev