SwiftUI - bridging context pointer correctly
Hi there! I have followed the documentation up until the streaming. We have all the data coming in from the subscription signal and would now like to use this data by appending it to an array. The only problem is that the closure won’t allow us to access self. I did the research and found out that we need to pass the context pointer into the closure to have its properties available from within. I also found this example on the forum of how to bridge it using conventional view controllers:
let _self: DeviceDetailViewController = bridge(ptr: context!)
My question now is how I could achieve the same thing using SwiftUI’s classes because I don’t have a ViewController I could assign the bridge to.
When I try the same with our NSObject class I get the errors above.
Is there any sample code for SwiftUI I could follow to get it working? Thanks in advance.