title: How can I display Touch Bar Buttons using SwiftUI?
body: <p>I'm trying to add Touch Bar support for a <code>SwiftUI</code> <code>View</code>. There seems to be <code>SwiftUI</code> API for this using the <code>.touchBar(content: () -&gt; View)</code> function on Views, but documentation is non existent and I can't get my Touch Bar to display anything.</p>
  
  <pre><code>import SwiftUI
  
  struct ContentView: View {
      var body: some View {
          Text("Hello, World!")
              .frame(maxWidth: .infinity, maxHeight: .infinity)
              .touchBar {
                  Button(action: {
  
                  }) {
                      Text("do something")
                  }
          }
      }
  }
  </code></pre>
  
  <p>This code does compile and run, but the Touch Bar remains empty. How can I get my touch bar to display content using SwiftUI (not catalyst)?</p>