title: Is there an easy way for a global variable between IOS and WatchOS App?
body: <p>This IOS app has the watchOS app included, the sending function works an is displayed on the watch, and the Counter counts on the IOS app, now I am wondering if there is an easy way to display the counted numbers on the watch, this is the ContentView Code.</p>
  <p>Devices</p>
  <p><img src="https://i.stack.imgur.com/WaPF8.png" alt="1" /></p>
  <pre><code>    import SwiftUI
  
  struct ContentView: View {
      var model = ViewModelPhone()
      @State var reachable = &quot;No&quot;
      @State var Message = &quot;&quot;
      @State var GolfCount :Int = 0
      var body: some View {
          VStack{
              Text(&quot;Reachable \(reachable)&quot;)
  
              
              Button(action: {
                  if self.model.session.isReachable{
                      self.reachable = &quot;Yes&quot;
                  }
                  else{
                      self.reachable = &quot;No&quot;
                  }
              }) {
                  Text(&quot;Update&quot;)
              }
              //mesage input
              TextField(&quot;Input your message&quot;, text: $Message)
                  .padding(100)
              Button(action: {
                  //message sending
                  self.model.session.sendMessage([&quot;message&quot; : self.Message], replyHandler: nil) { (error) in
                      print(error.localizedDescription)
                  }
              }) {
              Text(&quot;Send&quot;)
              } //golf Counting
              Button(action: {
                  
                  GolfCount += 1
                  })
              {
              Text(&quot;Schläge&quot;)
              Text(String(GolfCount))
              }}}}
  
  struct ContentView_Previews: PreviewProvider {
      static var previews: some View {
          ContentView()
      }
  }
  '''
  </code></pre>