Open DrAma999 opened 4 years ago
After further investigation, is not due to aliases, but the issue is due to the nature protocol of the mock CMBPeripheral
.
Yes, the original CBPeripheral
is a class, while in this library, theCBMPeripheral
is a protocol. For the same reason it's not Hashable
or Equatable
.
Regarding the publish, I could add those methods to the protocol, but the other protocols are more problematic.
Yes, the original
CBPeripgeral
is a class, while in this library, theCBMPeripheral
is a protocol. For the same reason it's notHashable
orEquatable
. Regarding the publish, I could add those methods to the protocol, but the other protocols are more problematic.
It would be wonderful, to test that functionality I made a little trick, but I'm not liking it that much. May I say that this project is simply amazing!. I'm trying to build a CB library , sort of Polidea RX Bluetooth but with combine and is helping me a lot in creating a good unit test coverage. Thank you!
@NickKibish, how is this issue related to #96? Is it fixed, or 96 solves just few cases?
Hello, I've added as swift package dependency CoreBluetoothMock library and added as suggested the
CoreBluetoothTypeAliases.swift
to the project. Removed any reference toimport CoreBluetooth
in my framework project. Everything seems ok, but I get an complire error here:What I'm trying to do is to leverage KVO and combine capabilities to create a publisher for peripheral
state
changes. At the line where I try to get the publisher I get Value of type 'CBPeripheral' (aka 'CBMPeripheral') has no member 'publisher'. I've tried also to import Foundation and Combine in the alias file, but I still get this error. I'm using Xcode 11.5 and the 0.8.0 version of the library.