Skip to content

Commit 1768778

Browse files
authored
Updated package to 6.2 (#56)
* Swift 6.2 BUILD OK * Updated actions to run with 6.2
1 parent a3f1dbf commit 1768778

26 files changed

Lines changed: 76 additions & 53 deletions

.github/workflows/swift.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,14 @@ jobs:
1515
runs-on: macos-latest
1616

1717
steps:
18-
- uses: actions/checkout@v4
19-
- name: Build
20-
run: swift build -v
21-
- name: Run tests
22-
run: swift test -v
18+
- uses: actions/checkout@v4
19+
- name: Setup Swift 6.2
20+
uses: swift-actions/setup-swift@v3
21+
with:
22+
swift-version: "6.2" # Specify the desired Swift version
23+
- name: Get Swift version
24+
run: swift --version # Verify the installed Swift version
25+
- name: Build Swift Package
26+
run: swift build -v
27+
- name: Run Swift Package Tests
28+
run: swift test -v

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version:5.9
1+
// swift-tools-version:6.2
22
// The swift-tools-version declares the minimum version of Swift required to build this package.
33

44
import PackageDescription

Sources/BLECombineKit/Central/BLECentralManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import CoreBluetooth
1111
import Foundation
1212

1313
/// Interface definining the Bluetooth Central Manager that provides Combine APIs.
14-
public protocol BLECentralManager: AnyObject {
14+
public protocol BLECentralManager: AnyObject, Sendable {
1515
/// Reference to the actual Bluetooth Manager, which is conveniently wrapped.
1616
var associatedCentralManager: CBCentralManagerWrapper { get }
1717

Sources/BLECombineKit/Central/BLECentralManagerDelegate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ typealias DidDiscoverAdvertisementDataResult = (
1111
peripheral: CBPeripheralWrapper, advertisementData: [String: Any], rssi: NSNumber
1212
)
1313

14-
final class BLECentralManagerDelegate: NSObject, CBCentralManagerDelegate {
14+
final class BLECentralManagerDelegate: NSObject, CBCentralManagerDelegate, @unchecked Sendable {
1515

1616
let didConnectPeripheral = PassthroughSubject<CBPeripheralWrapper, BLEError>()
1717
let didDisconnectPeripheral = PassthroughSubject<CBPeripheralWrapper, Never>()

Sources/BLECombineKit/Central/CBCentralManagerWrapper.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import Foundation
1111

1212
/// Interface for wrapping the CBCentralManager.
1313
/// This interface is critical in order to mock the CBCentralManager calls.
14-
public protocol CBCentralManagerWrapper {
14+
public protocol CBCentralManagerWrapper: Sendable {
1515
/// The CBCentralManager this interface wraps to.
1616
/// Note that CBCentralManager conforms to CBCentralManagerWrapper and this getter interface is a convenient way to avoid an expensive downcast. That is, if you need a fixed reference to the CBCentralManager object do not run `let validManager = manager as? CBCentralManager`, simply run `let validManager = manager.wrappedManager` which will run significantly faster.
1717
var wrappedManager: CBCentralManager? { get }

Sources/BLECombineKit/Central/StandardBLECentralManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Combine
1010
import CoreBluetooth
1111
import Foundation
1212

13-
final class StandardBLECentralManager: BLECentralManager {
13+
final class StandardBLECentralManager: BLECentralManager, @unchecked Sendable {
1414
/// The wrapped CBCentralManager.
1515
let associatedCentralManager: CBCentralManagerWrapper
1616

Sources/BLECombineKit/Characteristic/BLECharacteristic.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
//
88

99
import Combine
10-
import CoreBluetooth
10+
@preconcurrency import CoreBluetooth
1111

12-
public struct BLECharacteristic {
12+
public struct BLECharacteristic: Sendable {
1313
public let value: CBCharacteristic
1414
private let peripheral: BLEPeripheral
1515

Sources/BLECombineKit/Data/BLEData.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import Foundation
1010

11-
public struct BLEData {
11+
public struct BLEData: Sendable {
1212
public let value: Data
1313

1414
public init(value: Data) {

Sources/BLECombineKit/Error/BLEError.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,18 @@
66
// Copyright © 2020 Henry Serrano. All rights reserved.
77
//
88

9-
import CoreBluetooth
9+
@preconcurrency import CoreBluetooth
1010
import Foundation
1111

12-
extension NSError: Identifiable {
12+
extension NSError: @retroactive Identifiable {
1313

1414
}
1515

16-
extension CBError: Hashable, Identifiable {
16+
extension CBError: @retroactive Hashable, @retroactive Identifiable {
1717
public var id: Self { self }
1818
}
1919

20-
extension CBATTError: Hashable, Identifiable {
20+
extension CBATTError: @retroactive Hashable, @retroactive Identifiable {
2121
public var id: Self { self }
2222
}
2323

Sources/BLECombineKit/Peripheral Manager/BLEATTRequest.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import CoreBluetooth
1010

11-
public protocol BLEATTRequest {
11+
public protocol BLEATTRequest: Sendable {
1212
/// Reference to the actual request. Use this getter to obtain the CBATTRequest if needed. Note that CBATTRequest conforms to BLEATTRequest.
1313
var associatedRequest: CBATTRequest? { get }
1414

0 commit comments

Comments
 (0)