I am developing an iOS BLE application and everything works great. I am handling BLE in a singleton class that calls its discoverPeripheral()
method in the view controller's viewDidAppear()
. From there on I connect with devices and exchange data.
Now I'm trying to implement VIPER architecture in my app and I cant quite figure where this BLE part will be placed. Because currently my BLE code is activated when the view displays. I came up with the following scheme: Place the ble scanning in the presenter, and once the view comes into memory, request the presenter to start scanning. The presenter will ask the BLE singleton to scan with appropriate UUIDs and once data is received, inform Interactor to store it into the DB and then update UI.