Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import SwiftUI
struct ContentView : View {
@State var text = ""
var body: some View {
VStack {
TextField("Add text here", text: $text)
UIKitVC(text: $text)
struct UIKitVC: UIViewControllerRepresentable {
@Binding var text: String
func makeUIViewController(context: Context) -> ViewController {
func updateUIViewController(_ uiViewController: ViewController, context: Context) {
uiViewController.labelText.text = text
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment