Hey everyone. I'm trying to get the UI updated dep...
# compose-ios
d
Hey everyone. I'm trying to get the UI updated depending on a state change in SwiftUI using the
UIViewController
generated from the
ComposeUIViewController
function. I'm stuck trying to find a way to update the view controller (using a delegate/coordinator) but I can't find a way to create a custom
UIViewController
to pass the new state using the
updateNewUiupdateUIViewController
... Has anyone come across this? This would make me just rebuild everything in SwiftUI instead 😞
👍 2
d
We have a sample with interop between SwiftUI and Compose. https://github.com/JetBrains/compose-multiplatform/tree/master/examples/chat In this sample, text field value passing from SwiftUI to Compose.
d
Hey @Dima Avdeev, thank you for your message. Unfortunately, your CustomComposeUIViewController has the same limitations as mine. I have a full screen in Compose which receives a state and action to behave and the action works great but passing the new state doesn't update the UI because the UIViewController is not set to be updated upon changes in any particular value. The
makeUIViewController
creates the view and the
updateUIViewController
updates it when there are changes, but yours is not implemented. It seems not possible to update it since it would need a delegate coordinator as a bridge and that would require a custom UIViewController.
d
Well, I think we need to create a sample with two side interop between SwiftUI and Compose
Is the description of this issue correct?
d
Yes, thank you!
g