For an abstract input field that should be rendered in ForEach, given a struct,
struct InputFieldCustom: Identifiable, Hashable {
let id = UUID()
let placeholder: String
let imageResourceName: String
var storage: String = "email"
}
I would like to set text binding from storage var of this struct, is that possible by referencing a label?
ForEach(inputFields, id: \.self) { inputStruct in
TextField(inputStruct.placeholder, text: \.$storage)
}
(on the top of the view I have)
@State private var email = "") ?