Anas Altair
07/31/2023, 3:04 AMUIViewControllerRepresentable
where we can pass a @Binding
value, but how can we update the composable when this value is updated inside updateUIViewController
function?Anas Altair
07/31/2023, 3:05 AMstruct ComposeView: UIViewControllerRepresentable {
@Binding var value: Float
func makeUIViewController(context: Context) -> UIViewController {
return Main_iosKt.MainViewController(speed: value)
}
func updateUIViewController(_ uiViewController: UIViewController, context: Context) {
}
}
struct ContentView: View {
@State var value: Float = 0
var body: some View {
VStack {
ComposeView(value: self.$value)
.ignoresSafeArea(.all, edges: .bottom)
Button("Button") {
value = 1
}
}
}
}
Dima Avdeev
07/31/2023, 11:09 AMAnas Altair
07/31/2023, 3:41 PMComposeViewControllerToSwiftUI
Kashismails
08/01/2023, 9:26 AMAnas Altair
08/02/2023, 3:16 AMDavgdafa
08/18/2023, 9:47 PM