title: NavigationView inside a TabView Swift UI
body: <p>I'm just picking up SwiftUI after a long break but I don't understand why I can't place a <code>Navigation View</code> within a <code>Tab View</code>.</p>
  <p>I want my <code>Navigation View</code> to be a <code>.tabItem</code> so the view appears as part of the main app navigation so I'm trying this :</p>
  <pre><code>struct ContentView: View {
      var body: some View {
              TabView {
              
          NavigationView {
              
              .tabItem {
                  Text(&quot;Home&quot;)
              }
                      
              Text(&quot;Tab bar test&quot;)
                  .navigationBarTitle(&quot;Page One&quot;)
          }
  }
  </code></pre>
  <p>This doesn't work with error message</p>
  <pre><code>Cannot infer contextual base in reference to member 'tabItem'
  </code></pre>
  <p>But when I try this</p>
  <pre><code>    var body: some View {
          TabView {
          
      NavigationView {
                  
          Text(&quot;Tab bar test&quot;)
              .navigationBarTitle(&quot;Page One&quot;)
      }
  }
      .tabItem {
          Image(systemName: &quot;1.circle&quot;)
          Text(&quot;Home&quot;)
      }
  }
  </code></pre>
  <p>It builds fine but the tab bar doesn't show up.</p>
  <p>My primary question which I'm hoping would be useful to others, is ...</p>
  <p>Why can't I make a make a <code>Navigation View</code> a tab bar item by nesting <code>.tabItem</code> directly inside the <code>Navigation View</code> (as per my first example)?</p>
  <p>I think it's a similar question to <a href="https://stackoverflow.com/questions/67076068/navigationview-inside-tabview-duplicated-navigationbar-in-more-overflow-it">this one</a> but there's no code there. And then quite similar to <a href="https://stackoverflow.com/questions/65996670/navigationview-inside-tabview-how-to-get-to-top-level-tabview-when-using-the-ta">this one</a> but they seem to be using <code>.tabItem</code> directy with <code>ContentView</code> like I want to with <code>NavigationView</code> but that isn't building!?</p>
  <p>I'm probably misunderstanding something simple but I don't get this at all at the moment.</p>