This is my initial attempt at using Model that can be instantiated on the fly.
While this sort-of works, most Views rely on
CoreBluetooth-specific data to update their UI, which still makes it difficult to work with actual previews.
I think for this to work properly, I'd need to write protocols encompassing most of
CoreBluetooth's types (
CBCharacteristic, ...) so that I can then instantiate mocks (this should also help with writing tests later on).
So something like:
- Extends related
CoreBluetooth types to make them conform to those protocols
- Write Mocks which also conform
- Refactor views to rely on types which implement the protocols
- Refactor previews to use mocks
Let me know if this makes sense, it's quite a substantial effort but would definitely come in handy imo. If it does, I'll use this PR to work on this :)