title: iOS 15 SwiftUI Conditionals on a view with Navigation View makes NavigationBar config to be ignore if navigationViewStyle stack
body: <p>been searching for this everywhere and can't find anything around this, I believe is a bug, maybe is not.</p>
  <p>I need <code>NavigationView</code> with <code>.navigationViewStyle(.stack)</code> to have it stacked on the iPad and make it look the same as the iphone, now suppose you have this view:</p>
  <pre><code>import SwiftUI
  
  struct ContentView: View {
      @State var isShowingProfile = false
      @State var isNavigationViewShowing = true
      
      var body: some View {
          if isNavigationViewShowing {
              NavigationView {
                  VStack {
                      Button(&quot;Simple view&quot;) {
                          isNavigationViewShowing = false
                      }
                      .padding()
                      Button(&quot;Profile navigation&quot;) {
                          isShowingProfile = true
                          
                      }
                      .padding()
                      NavigationLink(
                          destination: ProfileView(),
                          isActive: $isShowingProfile
                      ) {
                          EmptyView()
                      }
                  }
                  .frame(
                      minWidth: 0,
                      maxWidth: .infinity,
                      minHeight: 0,
                      maxHeight: .infinity
                  )
                  .background(Color.gray)
                  .navigationBarHidden(true)
              }
              .navigationViewStyle(.stack)
          } else {
              VStack {
                  Button(&quot;Show NavigationView&quot;){
                      isNavigationViewShowing = true
                      
                  }
                  .padding()
              }
              .frame(
                  minWidth: 0,
                  maxWidth: .infinity,
                  minHeight: 0,
                  maxHeight: .infinity
              ).background(Color.yellow)
          }
      }
  }
  
  struct ProfileView: View {
      var body: some View {
          Text(&quot;This is a profile&quot;)
      }
  }
  
  
  struct ContentView_Previews: PreviewProvider {
      static var previews: some View {
          ContentView()
      }
  }
  </code></pre>
  <p>Well this just show this 3 simple views:</p>
  <ul>
  <li>The navigationView when you start</li>
  </ul>
  <p><a href="https://i.stack.imgur.com/8kyio.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8kyio.png" alt="The navigationView when you start" /></a></p>
  <ul>
  <li>The Profile view if you tap on &quot;Profile navigation&quot;</li>
  </ul>
  <p><a href="https://i.stack.imgur.com/PLCv1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PLCv1.png" alt="Profile view" /></a></p>
  <ul>
  <li>Finally the Simple view which is trigger by the conditional state pressing &quot;Simple view&quot;</li>
  </ul>
  <p><a href="https://i.stack.imgur.com/9K2Ws.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9K2Ws.png" alt="Simple view" /></a></p>
  <p>Up to here is all fine and good.</p>
  <p>The problem is when navigate to the &quot;Simple view&quot; and then tap &quot;Show NavigationView&quot; to navigate back to the NavigtionView.</p>
  <p>The app opens the first view (NavigationView), but the NavigationView ignores the <code>.navigationBarHidden(true)</code> and just show a big empty space on the top. In fact, it would ignore things like <code>.navigationBarTitleDisplayMode(.inline)</code> and just show the large version of the navigationBar</p>
  <p><a href="https://i.stack.imgur.com/b3Ilo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/b3Ilo.png" alt="Broken navigationView" /></a></p>
  <p>This is working correctly in all iOS 14.x, but on iOS 15.0 seems broken. The behaviour continues to be the same on iOS 15.1 beta.</p>
  <p>Any idea whats going on? I'm not really interested in changing the conditionals on the view, because real life app is more complex.</p>
  <p>Also, I tried ViewBuilder without any success. And if I take out <code>.navigationViewStyle(.stack)</code> it works all fine on iOS 15, but then the view on the iPad is with the side menu.</p>
  <p>Thanks a lot for any tip or help, you should be able to reproduce in simulator and real device.</p>
  <p><a href="https://streamable.com/rgqkef" rel="nofollow noreferrer">Video of the explained above</a></p>