when I try and change a variable in a function it just gives me
a error that says Cannot find 'textfield' in scope here is the is the code.
import SwiftUI
struct ContentView: View {
@State var test = "this is a test"
var body: some View {
Text("Hello")
}
}
func testfunc() {
test = "test"
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
a error that says Cannot find 'textfield' in scope here is the is the code.
import SwiftUI
struct ContentView: View {
@State var test = "this is a test"
var body: some View {
Text("Hello")
}
}
func testfunc() {
test = "test"
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}