title: How to update UI of a view from another view [ SwiftUI Question]
body: <p>I am new to Swift &amp; iOS dev in general.</p>
  <p>I am building an app in SwiftUI. Assume there are 2 separate views in different files: MainView() &amp; Results() and TabBar()(ignore the naming, this is just an example)(those 2 views are ON 2 SEPARATE TABS)</p>
  <p>My goal is to press on that button FROM ResultsView() and change the textValue property of MainView() to something else &amp; then display the change ON the MainView(). How can I do that? P.S Please ignore alignment &amp; etc. I am new to StackOverflow</p>
  <pre><code>struct MainView: View {
      
      @State var textValue: String = &quot;Old Text&quot;
      
      var body: some View {
          Text(textValue)
      }
      
  }
  
  struct TabBar: View {
      var body: some View {
          TabView {
              MainView()
                  .tabItem {
                      Label(&quot;Main&quot;, systemImage: &quot;circle.dashed.inset.filled&quot;)
                  }
              ResultsView()
                  .tabItem {
                      Label(&quot;Results&quot;, systemImage: &quot;person.2.crop.square.stack.fill&quot;)
                  }
          }
      }
  }
  
  struct ResultsView: View {
      
      var body: some View {
          Button {
              // HOW TO UPDATE MainView.textValue?
          } label: {
              Text(&quot;Update&quot;)
          }
      }
  }
  </code></pre>
  <ul>
  <li>ContentView() just has TabBar() in body</li>
  </ul>
  <p>Basically, my question is how do we change UI of certain view from another view? Without NavigationLink</p>
  <p>Might sound like a rookie question, but any reply will be so appreciated!</p>