ARTICLE AD BOX
The createRow function is as such:
func createRow(_ letter1:String, _ letter2:String, _ letter3:String) -> some View { var aSimpleRow : some View { HStack(alignment: .center) { Text(letter1) Text(letter2) Text(letter3) } }I need to use my Enter button to somehow update the @State var inputArray. For example the user taps and the array changes to ["%", "*", "&"] - and thus the corresponding text boxes also update to the same String values.
I created a button Struct:
struct EnterButtonView: View { var body: some View { Button(action: { enterButtonFunction() }) { // The label view HStack { Text("ENTER") } } } }I can easily create a func that returns an updated array - but I don't see how I can integrate that return value into the Content View and thus update one of the inputArrays.
I have been reading up on @State variables and how they work, I think I'm supposed to use them here for this purpose but coming across this issue I could be way off. I've seen people reference binding but that seems to be to send information between 2 views. Maybe that's applicable here since the button is a view and the Content View is its own view. I'm just unsure on how to approach this.
