title: Hiding Navigation Bar in case of multiple Navigation Views in SwiftUI
body: <p>I am having trouble hiding the navigation bar in case of multiple navigation views. I want navigation bars to be present on first and second screen but not on the third one.</p>
  <pre><code>struct FirstView: View {
  
      init() {
          UINavigationBar.appearance().backgroundColor = UIColor.green
      }
  
      var body: some View {
          NavigationView {
                  NavigationLink(destination: SecondView()) {
                      Text(&quot;Second View&quot;)
              }.navigationBarTitle(&quot;First View&quot;)
          }
      }
  }
   
  // Second View
  
  struct SecondView: View {
      var body: some View {
          NavigationLink(destination: ThirdView()) {
              Text(&quot;Third View&quot;)
          }
      }
  }
  
  // Third View 
  
  struct ThirdView: View {
  
      var body: some View {
          
              Text(&quot;Welcome&quot;)
              .navigationBarTitle(&quot;&quot;)
              .navigationBarHidden(true)
          
      }
  }
  </code></pre>
  <p>I tried hiding the navigation bar on third screen with the above code, but it doesn't work :(</p>
  <p><a href="https://i.stack.imgur.com/Tb1Vk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tb1Vk.png" alt="It doesn't hide the navigation bar" /></a></p>