Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Swift 6 compatibility ## ♻️ Current situation & Problem This PR adds support for Strict Concurrency Checking in SpeziBluetooth. With Xcode 16 beta 3, there are still some warnings about non-sendable key paths (in the UITest app), however this will be resolved with the next Xcode 16 beta (this is already resolved in the current release/6.0 swift toolchain snapshot). ## ⚙️ Release Notes * SpeziBluetooth now uses the `@SepziBluetooth` global actor to isolate all its state. All current `actor` types were migrated to `classes` that are isolated to the global actor. * All uses of CoreBluetooth's CBUUID are replaced with a new string literal expressible `BTUUID` type that is Sendable. All places that declared a String overload for `CBUUID`-based arguments (e.g., the `Characteristic` initializer or `DiscoveryCriteria` methods) removed these overloads in favor of the expressible by string literal conformance of `BTUUID`. * We removed all accesses to characteristic descriptors from the `@Characteristic` property wrapper. Descriptors are currently not supported anyways, something that is tracked in #11. * We removed the `BluetoothPeripheral/localName` property (also `@DeviceState(\.localName)`). Migrate your code to directly access the `AdvertisementData/localName` property. * We removed the `AdvertisementData/rawAdvertisementData` property and respective initializers to provide Sendable guarantees. Please use new typed initializers to initialize your testing data. * The `BluetoothPeripheral/services` property is no longer accessible via `@DeviceState` and is now isolated to the `@SpeziBluetooth` global actor. Use the existing `@Service` property wrapper for any service interactions. * The new `bluetoothScanningOptions(minimumRSSI:advertisementStaleInterval:)` view modifier replaces direct assignment of environment values of `minimumRSSI` and `advertisementStaleInterval`. Please migrate to using the new modifier. * Retrieving nearby devices using the Bluetooth module via `Bluetooth/nearbyDevices(for:)` is now isolated to the `@MainActor` for easy interaction with SwiftUI. * It is now recommended to implement `BluetoothService`s as structs (SpeziBluetoothServices was migrated accordingly). * A lot of state was synchronized through lock-free primitives using the Swift Atomics package 🚀 ## :books: Documentation All documentation was updated to reflect changes described above. ## :white_check_mark: Testing Existing unit tests and UI tests are still passing 🚀 ## :pencil: Code of Conduct & Contributing Guidelines By submitting creating this pull request, you agree to follow our [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md): - [x] I agree to follow the [Code of Conduct](https://github.com/StanfordSpezi/.github/blob/main/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/StanfordSpezi/.github/blob/main/CONTRIBUTING.md).
- Loading branch information