Your explanations are a bit hard to follow… I cannot understand how all the objects relate to each others.
What happens ? When you have 6 in Reps and type a 7 you get 67 ? Is that it ?
Where do you expect the TextField to be cleared?
Did you try to do it here, with onTap ?
VStack(alignment: .leading) {
Text("Reps")
.foregroundStyle(.gray)
.font(.subheadline)
TextField("\(set.reps)", value: $set.reps,formatter:Formatter.valueFormatter)
.keyboardType(.decimalPad)
.onTapGesture {
set.reps = 0
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: