SDBeaconScanner is a Swift library for scanning Bluetooth beacons using CoreLocation's beacon ranging API. It simplifies scanning for beacons by providing an easy-to-use API with support for UUID, major, and minor identifiers.
Since this framework uses closures instead of structured concurrency, I would highly recommend that you change the closure signature to use the Swift Result type.
from:
public typealias BeaconScanningCompletion = ([Beacon], Error?) -> Void
to:
public typealias BeaconScanningCompletion = (Result<[Beacon], BeaconErrorType>) -> Void
Why? Smart API signatures that do not inherit legacy objective-c style.
Either you should have beacons, or you should have an error. This also lets you constrain the error type so you don't need to typecast in your error handling code. It is really, beacons, or a specific domain error that you control.
Since this framework uses closures instead of structured concurrency, I would highly recommend that you change the closure signature to use the Swift Result type.
from: public typealias BeaconScanningCompletion = ([Beacon], Error?) -> Void
to: public typealias BeaconScanningCompletion = (Result<[Beacon], BeaconErrorType>) -> Void
Why? Smart API signatures that do not inherit legacy objective-c style.
Either you should have beacons, or you should have an error. This also lets you constrain the error type so you don't need to typecast in your error handling code. It is really, beacons, or a specific domain error that you control.