What is Nostr?
Sean Heber /
npub1qec…8ax9
2024-07-03 18:16:04

Sean Heber on Nostr: I want to use a binding with UIViewControllerRepresentable so I need to pass it on to ...

I want to use a binding with UIViewControllerRepresentable so I need to pass it on to the underlying UIViewController somehow.

I can pass the Binding<> struct itself all the way into the view controller and do stuff like binding.wrappedValue = newThing whenever the view controller wants to tell #SwiftUI about a change from its end.

But how do I observe from the UIViewController so it knows when the bound state value changes on the SwiftUI side (like from a button handler or whatever)?
Author Public Key
npub1qecr5745je9lkzcxarlwyyp9nwjxl7erkfxptm88xhsy65tcwteqws8ax9