title: How to create a popup menu below navigationitems in swiftui
body: <p>I want to create a popup menu like <a href="https://i.stack.imgur.com/71l4C.png" rel="nofollow noreferrer">this</a></p>
  
  <p>and it has a clear full screen overlay, when touch the overlay, popup menu will dismiss.</p>
  
  <p>I tried add an overlay to root view, and add a menu list view to it, hardcoding position and frame for it, align with navigationItem then create a EnvironmentObject to store the overlay's toggle.
  After this, I arrived my goal, but I think it was kind of mechanical, so my question is, is there has a good way to do this? like just use view modifier, or another with less step?</p>
  
  <p>This is my root view: </p>
  
  <pre><code>struct Root : View { 
      TabbedView {
          NavigationView {
             HomePage()
          }
      }.overlay(...)  &lt;-- add a overlay at root view.
  }
  
  struct HomePage : View {
      var body: some View {
          ZStack {
              List {...}
          }
          .navigationBarTitle("Home")
          .navigationBarItems(trailing: 
              Button(action: {
                  // show popup menu
              }) {
                  Image(systemName: "plus.circle")
              }
          )
      }
  }
  </code></pre>