CBPeripheral always nil swift playground

I connect to a CB Peripheral (discover, etc.) from a swift playground but can't save the reference.

Everytime I try to subseqently access the peripheral to write, it is nil.

I can write from inside a delegate callback such as didDiscoverCharacteristicFor Service using the provided callback peripheral ref but can't save it.

My standard method of storing in a global static struct didn't work so tried the value type enum in the sphero demo, didn't work.

I have needsIndefiniteExecution set and made a dummy ViewController() to keep things alive.

This same code works with a skinny swift 3 iPhone app.

Any help?

Thanks

Replies

Any luck with this one? I'm up against the same problem now 😟