Use Binding with a TextField SwiftUI

Actually , you can binding manyTypes with TextField:

      @State var weight: Int = 0
      var body: some View {


       Group{
       Text("\(weight)")
       TextField("Weight", value: $weight, formatter: NumberFormatter())
    }}

Leave a Comment