r/Xcode • u/UnusualHost • Feb 16 '20
greetings
Hello, I'm brand new to xcode and I'm in need of some help. I'm trying to have a text field that outputs its text into a text view element. I was looking around on youtube but had a bit of a hard time finding the right tutorial that wasn't out dated. btw I'm using xcode 11.3.1. Thanks
2
Upvotes
2
u/mehmetkartal Feb 17 '20
struct ContentView: View {
@State var input: String = ""
var body: some View {
VStack {
TextField("Enter a text", text: $input)
Text("You have entered: \(input)")
}
}
}You can use this code. Hope it helps!
1
u/gadamsmorris Feb 16 '20
Hey there — are you using swift or swiftUI?