title: How to unwrap an optional @State to be used in a call to something requiring a Binding in swiftui
body: <p>How do you unwrap an optional @State to be used as a binding parameter?</p>
  <pre><code>import SwiftUI
  
  struct ContentView: View {
      @State var testString = &quot;Hello&quot;
      var body: some View {
          TestView(test: testString)
      }
  }
  
  struct TestView : View {
      @State var test : String?
      var body: some View {
         TextField(&quot;Test&quot;, text: $test)
      }
  }
  
  struct ContentView_Previews: PreviewProvider {
      static var previews: some View {
          ContentView()
      }
  }
  </code></pre>
  <p>Here is the compiler error I receive on the TextField call.</p>
  <pre><code>Cannot convert value of type 'Binding&lt;String?&gt;' to expected argument type 'Binding&lt;String&gt;'
  </code></pre>