title: macOS SwiftUI App Tab View with Segmented Control in Toolbar
body: <p>I am trying to create a macOS app with SwiftUI. I need a <code>TabView</code> or something similar, but when I use <code>TabView</code> the segmented control is not in the macOS Toolbar. <a href="https://i.stack.imgur.com/ke3Qz.png" rel="nofollow noreferrer">Click here to see an example of what I would like</a></p>
  <p>My current code is:</p>
  <pre><code>import SwiftUI
  
  struct ContentView: View {
      var body: some View {
          TabView {
              Text(&quot;1&quot;)
                  .tabItem {
                      Text(&quot;1&quot;)
              }
          }
      }
  }
  
  </code></pre>
  <p><img src="https://i.stack.imgur.com/NjkWn.png" alt="The result is here as an image" /></p>
  <p>The segmented control needs to be in the toolbar and not the view.</p>
  <p>Thank you.</p>