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)?
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)?