title: Change value of Text while typing in TextField at a time without clicking anywhere - SwiftUI
body: <p>I'm trying to change value of <strong>Text</strong> while typing in <strong>TextField</strong>. When i type anything in TextField, i want to do some calculation with Textfield value and display it on Text. In Swift, we have <code>func textFieldDidChange(_ textField: UITextField)</code> delegate method of UITextField to track that UITextField is changed.<br></p>
  
  <p>In SwiftUI, i tried to create TextField with <code>onEditingChanged</code>. but somehow it is not going into that block. I don't know if i am doing anything wrong with it or not.</p>
  
  <pre><code>    @State var totalAmount: String = ""
      @State var addAmount: String = ""
      var body: some View {
  
              HStack {
                  TextField("0.0", text: $totalAmount, onEditingChanged: { _ in
                      self.addAmount = //doing some calculation with totalAmount
                  })
                  Text(self.addAmount)
  
              }
      }
  </code></pre>
  
  <p>Can anyone help with this?</p>