title: SwiftUI NSTitlebarAccessoryViewController
body: <p>I'd like to use the SwiftUI app lifecycle, but my app uses <code>NSTitlebarAccessoryViewController</code> to show a bar of tool options below the toolbar:</p>
  <p><a href="https://i.stack.imgur.com/nAy47.png" rel="noreferrer"><img src="https://i.stack.imgur.com/nAy47.png" alt="toolbar" /></a></p>
  <p>Specifically, I'm doing this:</p>
  <pre class="lang-swift prettyprint-override"><code>        let toolSettingsView = NSHostingView(rootView: ToolAccessoryView(model: model))
          let vc = NSTitlebarAccessoryViewController()
          vc.view = toolSettingsView
          vc.fullScreenMinHeight = accessoryHeight // Ensure tool settings are visible in full screen.
          toolSettingsView.frame.size = toolSettingsView.fittingSize
          window?.addTitlebarAccessoryViewController(vc)
  </code></pre>
  <p><strong>Is there a (practical) way I can mimic the control appearance (of the sliders, etc.) using pure SwiftUI?</strong> When use a SwiftUI view I get this:</p>
  <p><a href="https://i.stack.imgur.com/L7dCQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/L7dCQ.png" alt="enter image description here" /></a></p>
  <p>Code looks like this:</p>
  <pre class="lang-swift prettyprint-override"><code>struct MainView: View {
      
      var model: DataModel
      var undoManager: UndoManager
      
      var body: some View {
          VStack {
              ToolAccessoryView(model: model)
              SculptingView(model: model, undoManager: undoManager)
          }
      }
  }
  </code></pre>