Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Supereg committed Nov 6, 2024
1 parent 1368fbf commit 0dcea17
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,11 @@ public final class AccessorySetupKit {
}

nonisolated func cancelHandler(for id: UUID) {
#if canImport(AccessorySetupKit) && !targetEnvironment(macCatalyst) && !os(macOS)
subscriptionLock.withLock {
_ = accessoryChangeHandlers.removeValue(forKey: id)
}
#endif
}

#if canImport(AccessorySetupKit) && !targetEnvironment(macCatalyst) && !os(macOS)
Expand Down
26 changes: 26 additions & 0 deletions Sources/TestPeripheral/TestPeripheral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -275,3 +275,29 @@ final class TestPeripheral: NSObject, CBPeripheralManagerDelegate {
peripheral.respond(to: first, withResult: .success)
}
}


extension CBManagerState: @retroactive CustomStringConvertible, @retroactive CustomDebugStringConvertible {
public var description: String {
switch self {
case .unknown:
"unknown"
case .resetting:
"resetting"
case .unsupported:
"unsupported"
case .unauthorized:
"unauthorized"
case .poweredOff:
"poweredOff"
case .poweredOn:
"poweredOn"
@unknown default:
"CBManagerState(rawValue: \(rawValue))"
}
}

public var debugDescription: String {
description
}
}

0 comments on commit 0dcea17

Please sign in to comment.