title: Swiftui connect command to value in main view
body: <p>Does someone know how to connect commands to the rest of the project?<br>
  For example: I want to toggle the AddNew variable in the content view to show the add new item sheet by using the command.<br></p>
  <pre><code>struct SampleApp: App {
      var body: some Scene {
          WindowGroup {
              ContentView()
          }
          .commands {
               CommandGroup(after: CommandGroupPlacement.newItem) {
                  Button(&quot;Add new&quot;, action: {
                      
                  self.AddNew.toggle() // should toggle variable in content View
  
                  })
              }
          }
      }
  }
  
  struct ContentView: View {
   @State var AddNew = false
      var body: some View { 
  
          Button(action: {
              self.AddNew.toggle()
          }) {
              Text(&quot;Show Detail&quot;)
          }.sheet(isPresented: $AddNew) {
              AddNew(dimiss: $AddNew)
          }
  
   }
      
  }
  
  
  </code></pre>