title: Binding ViewModel and TextFields with SwiftUI
body: <p>I'm looking for the best way to create a bind between <code>textfields</code> and <code>ViewModel</code>. 
  At the moment I'm creating a <code>@State</code> for each textfield and I'm manually sending the value from textfield to the viewModel properties when needed. I'm pretty sure this is not the best way to go... Is there a way to bind the <code>TextField</code> with the <code>ViewModel</code> property? </p>
  
  <p>This is my current code: </p>
  
  <pre><code>struct SigninView: View {
      @State var username:String = ""
      @State var password:String = ""
  
      var viewModel:SignInViewModel
  
      var body: some View {
          VStack(alignment: .leading, spacing: 15.0){
  
              DefaultTextField(placeholder: "username", value: $username)
              DefaultTextField(placeholder: "password", value: $password)
  
              Spacer()
  
              FillButton(title:"Sign In"){
                  ///// IS THIS CORRECT?
                  self.viewModel.email = self.username
                  self.viewModel.password = self.password
                  //------------------
                  self.viewModel.signin()
              }
          }.padding()
      }
  }
  </code></pre>
  
  <p>The view model is something like: </p>
  
  <pre><code>class SignInViewModel:ObservableObject{
  
      var username:String? = nil
      var password:String? = nil
  </code></pre>