title: How we can read @State variable from other struct in SwiftUI?
body: <p>I want to know if there is simple or proper way to read a State variable value from a different View, I know the usage of .onChange or Binding or ObservableObject(class) and ..., but I like to know is there any other better way?</p>
  <p>For example in this code I have a View called TextView which has a State value, and I am calling this View inside my ContentView, Now I put a Text in my ContentView which I want to read the State Value of TextView. Is there a spacial method for this job?</p>
  <pre><code>struct ContentView: View {
      @State var readStringOfTextView: String = &quot;&quot;
  
      var body: some View {
          TextView()
  
          Text(readStringOfTextView)
              .foregroundColor(Color.blue)
      }
  }
  
  struct TextView: View {
      @State var stringOfText: String = &quot;Hello, world!&quot;
  
      var body: some View {
          Text(stringOfText)
              .padding()
              .foregroundColor(Color.red)
      }
  }
  </code></pre>