title: SwiftUI: Enable save button only when the inputs are not empty
body: <p>I've got a view with two text fields and a save button. How can I possibly change my button's state depending on the contents of the text fields (I'd like to enable the button only in case all text fields are not empty)? Here's my current code:</p>
  
  <pre><code>// The variables associated with text fields
  @State var name: String = ""
  @State var type: String = ""
  
  // I'd like to associate this variable with
  // my button's disabled / enabled state,
  // but the function responsible for it doesn't accept bindings
  @State var canSave: Bool = false
  
  var body: some View {
      Form {
          TextField("Name", text: $name)
          TextField("Type", text: $type)
  
          Button(action: {
              // ...
          }, label: {
              Text("Save")
          })
              .disabled(!canSave) // no bindings allowed here; what to use indead?
      }
  }
  </code></pre>
  
  <p>I have an idea that I should use <code>combineLatest</code> from the newest Combine framework. But whatever I try to google leads me to RxSwift-related topics and not actual Combine implementation.</p>