Domanda

I lose my bluetooth connection every time I try to change the ViewController

I put the CBPeripheralManagerDelegate Methods in each ViewController.

How should I reorganize my code ?

È stato utile?

Soluzione

you must CBCentralManager trough ViewControllers on PrepareForSegue method so it will retain the instance

create new class for implement CBPeripheralManagerDelegate and create its instance and pass it

you can use prepare for segue method accordingly this sample

How to pass prepareForSegue: an object

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top