title: How do I add a toolbar to a macOS app using SwiftUI?
body: <p>I am trying to add a toolbar inside the title bar to a macOS app using SwiftUI, something similar to what is shown below. </p>
  
  <p><a href="https://i.stack.imgur.com/0J8Eo.png" rel="noreferrer"><img src="https://i.stack.imgur.com/0J8Eo.png" alt="Toolbar in the titlebar in macOS app"></a></p>
  
  <p>I am unable to figure out a way to achieve this using SwiftUI. Currently, I have my toolbar (which just has a text field) inside my view, but I want to move it into the title bar.</p>
  
  <p>My current code:</p>
  
  <pre><code>struct TestView: View {
      var body: some View {
          VStack {
              TextField("Placeholder", text: .constant("")).padding()
              Spacer()
          }
      }
  }
  </code></pre>
  
  <p>So, in my case, I need to have the textfield inside the toolbar.</p>