import SwiftUI
struct viewdetail: View {
@State var text1:String = ""
@State var tip1:String = ""
@State var text23:String = ""
@State var tip23:String = ""
var body: some View {
Text(text1);Text(tip1);Text(text23);Text(tip23)
}
}
func detailLine(costa:inout [Double],tipa:inout [Double]) {
print(costa,tipa)
text1 = "125" cannot find 'text1' in scope
print("detail")
}
func delete(costa:inout [Double],tipa:inout [Double],number: inout Int) {
print(costa,tipa)
tipa.removeLast()
costa.removeLast()
number -= 1
print(costa,tipa)
}
#Preview { viewdetail() }
Does anyone know why I'm getting "cannot find text1 in scope"?