From 4025ea6230b41a0cf10b7a41388fc345fd66b5a3 Mon Sep 17 00:00:00 2001 From: Nick Kibysh Date: Tue, 19 Sep 2023 16:15:24 +0200 Subject: [PATCH 1/9] Added description --- .../CentralManager/CentralManager.swift | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/Sources/iOS-BLE-Library/CentralManager/CentralManager.swift b/Sources/iOS-BLE-Library/CentralManager/CentralManager.swift index 23a269e..0661bd1 100644 --- a/Sources/iOS-BLE-Library/CentralManager/CentralManager.swift +++ b/Sources/iOS-BLE-Library/CentralManager/CentralManager.swift @@ -24,9 +24,9 @@ extension CentralManager { public var localizedDescription: String { switch self { case .wrongManager: - return "Incorrect manager instance provided." + return "Incorrect manager instance provided. Delegate must be of type ReactiveCentralManagerDelegate." case .badState(let state): - return "Bad state: \(state)" + return "Bad state: \(state)." case .unknownError: return "An unknown error occurred." } @@ -170,6 +170,7 @@ extension CentralManager { // MARK: Retrieving Lists of Peripherals extension CentralManager { + #warning("check `connect` method") /// Returns a list of the peripherals connected to the system whose /// services match a given set of criteria. /// @@ -200,14 +201,17 @@ extension CentralManager { // MARK: Scanning or Stopping Scans of Peripherals extension CentralManager { + #warning("Question: Should we throw an error if the scan is already running?") /// Initiates a scan for peripherals with the specified services. + /// + /// Calling this method stops an ongoing scan if it is already running and finishes the publisher returned by ``scanForPeripherals(withServices:)``. + /// /// - Parameter services: The services to scan for. - /// - Returns: A publisher that emits scan results or errors. + /// - Returns: A publisher that emits scan results or an error. public func scanForPeripherals(withServices services: [CBUUID]?) -> Publishers.BluetoothPublisher { stopScan() - // TODO: Change to BluetoothPublisher return centralManagerDelegate.stateSubject .tryFirst { state in guard let determined = state.ready else { return false } From 58b6a83f6e0f9a1bdce70013061dd4520acef6b8 Mon Sep 17 00:00:00 2001 From: Nick Kibysh Date: Tue, 19 Sep 2023 16:16:24 +0200 Subject: [PATCH 2/9] Added documentation for BluetoothPublisher --- .../Publishers/Publishers+Bluetooth.swift | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Sources/iOS-BLE-Library/Utilities/Publishers/Publishers+Bluetooth.swift b/Sources/iOS-BLE-Library/Utilities/Publishers/Publishers+Bluetooth.swift index 8b72a6f..426e26f 100644 --- a/Sources/iOS-BLE-Library/Utilities/Publishers/Publishers+Bluetooth.swift +++ b/Sources/iOS-BLE-Library/Utilities/Publishers/Publishers+Bluetooth.swift @@ -17,6 +17,26 @@ extension Publisher { } extension Publishers { + + /** + A publisher that is used for most of the Bluetooth operations. + + # Overview + This publisher conforms to the `ConnectablePublisher` protocol because most of the Bluetooth operations have to be set up before they can be used. + + It means that the publisher will not emit any values until it is connected. The connection is established by calling the `connect()` or `autoconnect()` methods. + To learn more about the `ConnectablePublisher` protocol, see [Apple's documentation](https://developer.apple.com/documentation/combine/connectablepublisher). + + ```swift + let publisher = centralManager.scanForPeripherals(withServices: nil) + .autoconnect() + // chain of publishers + .sink { + // . . . + } + .store(in: &cancellables) + ``` + */ public class BluetoothPublisher: ConnectablePublisher { private let inner: BaseConnectable From 97f27bc54fa800ad0f879a04b21d665c7aa7f8e5 Mon Sep 17 00:00:00 2001 From: Nick Kibysh Date: Tue, 19 Sep 2023 16:16:33 +0200 Subject: [PATCH 3/9] Added Documentation --- .../Documentation.docc/Documentation.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 Sources/iOS-BLE-Library/Documentation.docc/Documentation.md diff --git a/Sources/iOS-BLE-Library/Documentation.docc/Documentation.md b/Sources/iOS-BLE-Library/Documentation.docc/Documentation.md new file mode 100644 index 0000000..47c0134 --- /dev/null +++ b/Sources/iOS-BLE-Library/Documentation.docc/Documentation.md @@ -0,0 +1,19 @@ +# ``iOS_BLE_Library`` + +This library is a wrapper around the CoreBluetooth framework which provides a modern async API based on Combine Framework. + +The library has been designed to have a simple API similar to the one provided by the CoreBluetooth framework. +So if you are familiar with the CoreBluetooth framework, you will be able to use this library without any problem. + +## Topics + +### Central Manager +- ``CentralManager`` +- ``ReactiveCentralManagerDelegate`` + +### Peripheral +- ``Peripheral`` +- ``ReactivePeripheralDelegate`` + +### Essentials +- ``iOS_BLE_Library/Combine/Publishers/BluetoothPublisher`` From 5fac16104a5c87ab9210da39571266b1d80b1dc1 Mon Sep 17 00:00:00 2001 From: Nick Kibysh Date: Tue, 19 Sep 2023 18:13:38 +0200 Subject: [PATCH 4/9] added documentation for ReactiveDelegate and CentralManager --- .../CentralManager/CentralManager.swift | 16 ++-- .../CentralManager/CentralManager.md | 21 +++++ .../ReactiveCentralManagerDelegate.md | 16 ++++ .../Publishers/Publishers+Peripheral.swift | 77 ------------------- 4 files changed, 47 insertions(+), 83 deletions(-) create mode 100644 Sources/iOS-BLE-Library/Documentation.docc/CentralManager/CentralManager.md create mode 100644 Sources/iOS-BLE-Library/Documentation.docc/CentralManager/ReactiveCentralManagerDelegate.md delete mode 100644 Sources/iOS-BLE-Library/Utilities/Publishers/Publishers+Peripheral.swift diff --git a/Sources/iOS-BLE-Library/CentralManager/CentralManager.swift b/Sources/iOS-BLE-Library/CentralManager/CentralManager.swift index 0661bd1..5913715 100644 --- a/Sources/iOS-BLE-Library/CentralManager/CentralManager.swift +++ b/Sources/iOS-BLE-Library/CentralManager/CentralManager.swift @@ -59,14 +59,18 @@ private class Observer: NSObject { } } -/// A custom Central Manager class that extends the functionality of the standard CBCentralManager. -/// This class brings a reactive approach and is based on the Swift Combine framework. +/// A Custom Central Manager class. +/// +/// It wraps the standard CBCentralManager and has similar API. However, instead of using delegate, it uses publishers, thus bringing the reactive programming paradigm to the CoreBluetooth framework. public class CentralManager { private let isScanningSubject = CurrentValueSubject(false) private let killSwitchSubject = PassthroughSubject() private lazy var observer = Observer(cm: centralManager, publisher: isScanningSubject) + /// The underlying CBCentralManager instance. public let centralManager: CBCentralManager + + /// The reactive delegate for the ``centralManager``. public let centralManagerDelegate: ReactiveCentralManagerDelegate /// Initializes a new instance of `CentralManager`. @@ -146,7 +150,7 @@ extension CentralManager { /// Cancels the connection with the specified peripheral. /// - Parameter peripheral: The peripheral to disconnect from. /// - Returns: A publisher that emits the disconnected peripheral. - public func cancelPeripheralConnection(_ peripheral: CBPeripheral) -> Publishers.Peripheral + public func cancelPeripheralConnection(_ peripheral: CBPeripheral) -> Publishers.BluetoothPublisher { return self.disconnectedPeripheralsChannel .tryFilter { r in @@ -162,9 +166,9 @@ extension CentralManager { } .map { $0.0 } .first() - .peripheral { - self.centralManager.cancelPeripheralConnection(peripheral) - } + .bluetooth { + self.centralManager.cancelPeripheralConnection(peripheral) + } } } diff --git a/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/CentralManager.md b/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/CentralManager.md new file mode 100644 index 0000000..21a7fcc --- /dev/null +++ b/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/CentralManager.md @@ -0,0 +1,21 @@ +# ``iOS_BLE_Library/CentralManager`` + +## Topics + +Loren ipsum + +Loren Ipsum + +## Channels + +Channels are used to pass through data from the `CBCentralManagerDelegate` methods. +You can consider them as a reactive version of the `CBCentralManagerDelegate` methods. + +In most cases, you will not need to use them directly, as `centralManager`'s methods return proper publishers. +However, if you need to handle the data in a different way (e.g. log all the events), you can subscribe to the channels directly. + +- ``stateChannel`` +- ``isScanningChannel`` +- ``scanResultsChannel`` +- ``connectedPeripheralChannel`` +- ``disconnectedPeripheralsChannel`` diff --git a/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/ReactiveCentralManagerDelegate.md b/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/ReactiveCentralManagerDelegate.md new file mode 100644 index 0000000..c663b32 --- /dev/null +++ b/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/ReactiveCentralManagerDelegate.md @@ -0,0 +1,16 @@ +# ``iOS_BLE_Library/ReactiveCentralManagerDelegate`` + +Implementation of the `CBCentralManagerDelegate`. + +`ReactiveCentralManagerDelegate` is a class that implements the `CBCentralManagerDelegate` and is an essential part of the ``CentralManager`` class. + +It brings a reactive programming approach, utilizing Combine publishers to seamlessly handle Bluetooth events and data. +This class allows to monitor and respond to events such as peripheral connection, disconnection, and scanning for peripherals. + +It has all needed publishers that are used for handling Bluetooth events and data. + +## Override + +It's possible to override the default implementation of the `ReactiveCentralManagerDelegate` by creating a new class that inherits from `ReactiveCentralManagerDelegate` and overriding the needed methods. + +However, it's important to call the `super` implementation of the method, otherwise it will break the `CentralManager` functionality. diff --git a/Sources/iOS-BLE-Library/Utilities/Publishers/Publishers+Peripheral.swift b/Sources/iOS-BLE-Library/Utilities/Publishers/Publishers+Peripheral.swift deleted file mode 100644 index d0cd8f8..0000000 --- a/Sources/iOS-BLE-Library/Utilities/Publishers/Publishers+Peripheral.swift +++ /dev/null @@ -1,77 +0,0 @@ -// -// File.swift -// -// -// Created by Nick Kibysh on 25/04/2023. -// - -import Combine -//CG_REPLACE -import CoreBluetooth -//CG_WITH -/* -import CoreBluetoothMock -*/ -//CG_END -import Foundation - -extension Publisher where Output == CBPeripheral, Failure == Error { - func peripheral(_ fire: @escaping () -> Void) -> Publishers.Peripheral { - Publishers.Peripheral(self, fire: fire) - } -} - -extension Publishers.Peripheral { - var value: Output { - get async throws { - try await ContinuationSubscriber.withCheckedContinuation(self) - } - } -} - -extension Publishers { - public class Peripheral: ConnectablePublisher { - public typealias Output = CBPeripheral - public typealias Failure = Error - - private let inner: BaseConnectable - - init( - _ publisher: PublisherType, fire: @escaping () -> Void - ) where Output == PublisherType.Output, Failure == PublisherType.Failure { - self.inner = ClosureConnectablePublisher(upstream: publisher, fire: fire) - } - - public func receive(subscriber: S) - where S: Subscriber, Failure == S.Failure, CBPeripheral == S.Input { - inner.receive(subscriber: subscriber) - } - - public func connect() -> Cancellable { - return inner.connect() - } - } - - public class Service: ConnectablePublisher { - public typealias Output = CBService - public typealias Failure = Error - - private let inner: BaseConnectable - - init( - _ publisher: PublisherType, fire: @escaping () -> Void - ) where Output == PublisherType.Output, Failure == PublisherType.Failure { - self.inner = ClosureConnectablePublisher(upstream: publisher, fire: fire) - } - - public func receive(subscriber: S) - where S: Subscriber, Failure == S.Failure, CBService == S.Input { - inner.receive(subscriber: subscriber) - } - - public func connect() -> Cancellable { - return inner.connect() - } - } - -} From 9cf2035545e24cf2b0cde5499ee2062d45be5647 Mon Sep 17 00:00:00 2001 From: Nick Kibysh Date: Fri, 22 Sep 2023 22:48:39 +0200 Subject: [PATCH 5/9] Added comments to Peripheral's methods --- .../Peripheral/Peripheral.swift | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/Sources/iOS-BLE-Library/Peripheral/Peripheral.swift b/Sources/iOS-BLE-Library/Peripheral/Peripheral.swift index 996d6c0..4582fb3 100644 --- a/Sources/iOS-BLE-Library/Peripheral/Peripheral.swift +++ b/Sources/iOS-BLE-Library/Peripheral/Peripheral.swift @@ -83,7 +83,10 @@ public class Peripheral { case badDelegate } + /// The underlying CBPeripheral instance. public let peripheral: CBPeripheral + + /// The delegate for handling peripheral events. public let peripheralDelegate: ReactivePeripheralDelegate private let stateSubject = CurrentValueSubject(.disconnected) @@ -101,6 +104,11 @@ public class Peripheral { ) // TODO: Why don't we use default delegate? + /// Initializes a Peripheral instance. + /// + /// - Parameters: + /// - peripheral: The CBPeripheral to manage. + /// - delegate: The delegate for handling peripheral events. public init(peripheral: CBPeripheral, delegate: ReactivePeripheralDelegate) { self.peripheral = peripheral self.peripheralDelegate = delegate @@ -125,6 +133,7 @@ public class Peripheral { // MARK: - Channels extension Peripheral { + /// A publisher for the current state of the peripheral. public var peripheralStateChannel: AnyPublisher { stateSubject.eraseToAnyPublisher() } @@ -132,6 +141,10 @@ extension Peripheral { extension Peripheral { // TODO: Extract repeated code + /// Discover services for the peripheral. + /// + /// - Parameter serviceUUIDs: An optional array of service UUIDs to filter the discovery results. If nil, all services will be discovered. + /// - Returns: A publisher emitting discovered services or an error. public func discoverServices(serviceUUIDs: [CBUUID]?) -> Publishers.BluetoothPublisher { @@ -161,6 +174,12 @@ extension Peripheral { } } + /// Discover characteristics for a given service. + /// + /// - Parameters: + /// - characteristicUUIDs: An optional array of characteristic UUIDs to filter the discovery results. If nil, all characteristics will be discovered. + /// - service: The service for which to discover characteristics. + /// - Returns: A publisher emitting discovered characteristics or an error. public func discoverCharacteristics( _ characteristicUUIDs: [CBUUID]?, for service: CBService ) -> Publishers.BluetoothPublisher { @@ -196,6 +215,10 @@ extension Peripheral { } } + /// Discover descriptors for a given characteristic. + /// + /// - Parameter characteristic: The characteristic for which to discover descriptors. + /// - Returns: A publisher emitting discovered descriptors or an error. public func discoverDescriptors(for characteristic: CBCharacteristic) -> Publishers.BluetoothPublisher { @@ -221,6 +244,12 @@ extension Peripheral { // MARK: - Writing Characteristic and Descriptor Values extension Peripheral { + /// Write data to a characteristic and wait for a response. + /// + /// - Parameters: + /// - data: The data to write. + /// - characteristic: The characteristic to write to. + /// - Returns: A publisher indicating success or an error. public func writeValueWithResponse(_ data: Data, for characteristic: CBCharacteristic) -> Publishers.BluetoothPublisher { @@ -239,10 +268,20 @@ extension Peripheral { } } + /// Write data to a characteristic without waiting for a response. + /// + /// - Parameters: + /// - data: The data to write. + /// - characteristic: The characteristic to write to. public func writeValueWithoutResponse(_ data: Data, for characteristic: CBCharacteristic) { peripheral.writeValue(data, for: characteristic, type: .withoutResponse) } + /// Write data to a descriptor. + /// + /// - Parameters: + /// - data: The data to write. + /// - descriptor: The descriptor to write to. public func writeValue(_ data: Data, for descriptor: CBDescriptor) { fatalError() } @@ -250,10 +289,18 @@ extension Peripheral { // MARK: - Reading Characteristic and Descriptor Values extension Peripheral { + /// Read the value of a characteristic. + /// + /// - Parameter characteristic: The characteristic to read from. + /// - Returns: A future emitting the read data or an error. public func readValue(for characteristic: CBCharacteristic) -> Future { return reader.readValue(from: characteristic) } + /// Listen for updates to the value of a characteristic. + /// + /// - Parameter characteristic: The characteristic to monitor for updates. + /// - Returns: A publisher emitting characteristic values or an error. public func listenValues(for characteristic: CBCharacteristic) -> AnyPublisher { return peripheralDelegate.updatedCharacteristicValuesSubject @@ -268,6 +315,10 @@ extension Peripheral { .eraseToAnyPublisher() } + /// Read the value of a descriptor. + /// + /// - Parameter descriptor: The descriptor to read from. + /// - Returns: A future emitting the read data or an error. public func readValue(for descriptor: CBDescriptor) -> Future { fatalError() } @@ -275,6 +326,12 @@ extension Peripheral { // MARK: - Setting Notifications for a Characteristic’s Value extension Peripheral { + /// Set notification state for a characteristic. + /// + /// - Parameters: + /// - isEnabled: Whether notifications should be enabled or disabled. + /// - characteristic: The characteristic for which to set the notification state. + /// - Returns: A publisher indicating success or an error. public func setNotifyValue(_ isEnabled: Bool, for characteristic: CBCharacteristic) -> Publishers.BluetoothPublisher { From c8d36bf8f91a05d51c78d1ebf61eecece94adbff Mon Sep 17 00:00:00 2001 From: Nick Kibysh Date: Sat, 23 Sep 2023 23:22:15 +0200 Subject: [PATCH 6/9] Added documentation for connection process and channels in CentralManager --- .../CentralManager/CentralManager.md | 48 ++++++++++++++++--- 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/CentralManager.md b/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/CentralManager.md index 21a7fcc..df124bc 100644 --- a/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/CentralManager.md +++ b/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/CentralManager.md @@ -1,18 +1,54 @@ # ``iOS_BLE_Library/CentralManager`` -## Topics +### Connection + +Use ``CentralManager/connect(_:options:)`` to connect to a peripheral. +The returned publisher will emit the connected peripheral or an error if the connection fails. +The publisher will not complete until the peripheral is disconnected. +If the connection fails, or the peripheral is unexpectedly disconnected, the publisher will fail with an error. -Loren ipsum +> The publisher returned by ``CentralManager/connect(_:options:)`` is a `ConnectablePublisher`. Therefore, you need to call `connect()` or `autoconnect()` to initiate the connection process. -Loren Ipsum +```swift +centralManager.connect(peripheral) + .autoconnect() + .sink { completion in + switch completion { + case .finished: + print("Peripheral disconnected successfully") + case .failure(let error): + print("Error: \(error)") + } + } receiveValue: { peripheral in + print("Peripheral connected: \(peripheral)") + } + .store(in: &cancellables) +``` -## Channels +### Channels Channels are used to pass through data from the `CBCentralManagerDelegate` methods. You can consider them as a reactive version of the `CBCentralManagerDelegate` methods. -In most cases, you will not need to use them directly, as `centralManager`'s methods return proper publishers. -However, if you need to handle the data in a different way (e.g. log all the events), you can subscribe to the channels directly. +In most cases, you will not need to use them directly, as `centralManager`'s methods return proper publishers. However, if you need to handle the data differently (e.g., log all the events), you can subscribe to the channels directly. + +All channels have `Never` as their failure type because they never fail. Some channels, like `CentralManager/connectedPeripheralChannel` or `CentralManager/disconnectedPeripheralsChannel`, send tuples with the peripheral and the error, allowing you to handle errors if needed. Despite this, the failure type remains `Never`, so it will not complete even if an error occurs during the connection or disconnection of the peripheral. + +```swift +centralManager.connectedPeripheralChannel + .sink { peripheral, error in + if let error = error { + print("Error: \(error)") + } else { + print("New peripheral connected: \(peripheral)" + } + } + .store(in: &cancellables) +``` + +## Topics + +### Channels - ``stateChannel`` - ``isScanningChannel`` From 2610cf945d64448c6b2467b566da7716dc446291 Mon Sep 17 00:00:00 2001 From: Nick Kibysh Date: Sun, 24 Sep 2023 22:47:20 +0200 Subject: [PATCH 7/9] More structure and text in CentralManager's documentation --- .../CentralManager/CentralManager.md | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/CentralManager.md b/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/CentralManager.md index df124bc..19e34cc 100644 --- a/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/CentralManager.md +++ b/Sources/iOS-BLE-Library/Documentation.docc/CentralManager/CentralManager.md @@ -1,5 +1,13 @@ # ``iOS_BLE_Library/CentralManager`` +### Create a Central Manager + +Since it's not recommended to override the `CBCentralManager`'s methods, ``CentralManager`` is merely a wrapper around `CBCentralManager` with an instance of it inside. + +The new instance of `CBCentralManager` can be created during initialization using ``init(centralManagerDelegate:queue:)``, or an existing instance can be passed using ``init(centralManager:)``. + +If you pass a central manager inside ``init(centralManager:)``, it should already have a delegate set. The delegate should be an instance of ``ReactiveCentralManagerDelegate``; otherwise, an error will be thrown. + ### Connection Use ``CentralManager/connect(_:options:)`` to connect to a peripheral. @@ -48,6 +56,28 @@ centralManager.connectedPeripheralChannel ## Topics +### Initializers + +- ``init(centralManagerDelegate:queue:)`` +- ``init(centralManager:)`` + +### Instance Properties + +- ``centralManager`` +- ``centralManagerDelegate`` + +### Scan + +- ``scanForPeripherals(withServices:)`` +- ``stopScan()`` +- ``retrievePeripherals(withIdentifiers:)`` + +### Connection + +- ``connect(_:options:)`` +- ``cancelPeripheralConnection(_:)`` +- ``retrieveConnectedPeripherals(withServices:)`` + ### Channels - ``stateChannel`` From b91485cc1ac319d29ec6889bae1416645389a4ea Mon Sep 17 00:00:00 2001 From: Nick Kibysh Date: Mon, 25 Sep 2023 21:53:58 +0200 Subject: [PATCH 8/9] Added `Peripheral` file for documentation --- .../Documentation.docc/Peripheral/Peripheral.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 Sources/iOS-BLE-Library/Documentation.docc/Peripheral/Peripheral.md diff --git a/Sources/iOS-BLE-Library/Documentation.docc/Peripheral/Peripheral.md b/Sources/iOS-BLE-Library/Documentation.docc/Peripheral/Peripheral.md new file mode 100644 index 0000000..7628658 --- /dev/null +++ b/Sources/iOS-BLE-Library/Documentation.docc/Peripheral/Peripheral.md @@ -0,0 +1,5 @@ +``iOS_BLE_Library/Peripheral`` + +### Create a Peripheral + + From 8dacb12b20b32a52aa3ac2543689e13adde90bc8 Mon Sep 17 00:00:00 2001 From: Nick Kibysh Date: Sun, 1 Oct 2023 15:49:53 +0200 Subject: [PATCH 9/9] removed undesired CentralManager's delegate method --- .../CentralManager/ReactiveCentralManagerDelegate.swift | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Sources/iOS-BLE-Library/CentralManager/ReactiveCentralManagerDelegate.swift b/Sources/iOS-BLE-Library/CentralManager/ReactiveCentralManagerDelegate.swift index eed5342..e39be1e 100644 --- a/Sources/iOS-BLE-Library/CentralManager/ReactiveCentralManagerDelegate.swift +++ b/Sources/iOS-BLE-Library/CentralManager/ReactiveCentralManagerDelegate.swift @@ -75,12 +75,6 @@ open class ReactiveCentralManagerDelegate: NSObject, CBCentralManagerDelegate { stateSubject.send(central.state) } - public func centralManager( - _ central: CBCentralManager, willRestoreState dict: [String: Any] - ) { - unimplementedError() - } - // MARK: Monitoring the Central Manager’s Authorization #if !os(macOS) public func centralManager(