Post

Replies

Boosts

Views

Activity

How to fix the TextField?
HStack {Text("Calculated number"); TextField("", value: $calculated, format: .number) }             HStack {Text("Calculate number"); TextField("", value: $calculator, format: .number) }             HStack {Text("Calculate way"); TextField("", value: $calculateway, format: .number)} For the code above, Xcode will show error: Can't find $calculated, $calculator and $calculateway. How to solve this error? Also I want to create a Label that shows word:'Result:'and a variable called calresult but I don't know how to make the Label, can anyone give me the code to create the Label I said? I hope the Label will show these text, (calresult)means the data in calresult: Result: (calresult)
2
0
1k
Mar ’22
How to solve these TextField and Label problem?
TextField("Calculated number", value: $calculated, format: Float)             TextField("Calculate number", text: $calculator, format: Float)             TextField("Calculate way", text: $calculateway, format: Float) How to solve the errors: 'Cannot find $calculated, $calculator and $calculated in scope'? Also this Label(Maybe I don't know how to make): Label("Result:"+$calresult, systemImage: "42.circle") How to solve this error: 'Cannot find $calresult in scope'?
1
0
772
Mar ’22