title: SwiftUI Show navigation bar title on the back button but not in the previous View
body: <p>I have two views, one leads to the other. I want that the second view uses the title of the first view for the back button, which should then be: &quot;&lt;View1&quot;.
  I don't want to show the title in the first view.</p>
  <p>Problem: I can't hide navigation bar because it will also hide a <em>custom button</em> which is within it. Setting <code>.navigationTitle(&quot;&quot;)</code> hides the title in the first view, but also hides it from the back button in the second view.</p>
  <p>What I have now:</p>
  <p><a href="https://i.stack.imgur.com/ml5Hwl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ml5Hwl.png" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/HSsgll.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HSsgll.png" alt="enter image description here" /></a></p>
  <p>What I would like to have:</p>
  <p><a href="https://i.stack.imgur.com/ei2mUl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ei2mUl.png" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/v0ahGl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v0ahGl.png" alt="enter image description here" /></a></p>
  <p>Code:</p>
  <pre><code>struct ContentView: View {
      @State var isLinkActive = false
      
      var body: some View {
          NavigationView {
              VStack {
              NavigationLink(&quot;go to the second view&quot;, destination: SecondView(), isActive: $isLinkActive).navigationTitle(&quot;View1&quot;)
                  .navigationBarItems(leading: Button(action: {
                      ()
                  }, label: {
                      Text(&quot;custom button&quot;)
                  }))
              }
          }.navigationViewStyle(StackNavigationViewStyle())
          
      }
      
      private func btnPressed() {
          isLinkActive = true
      }
  }
  
  struct SecondView: View {
      var body: some View {
          Color.blue
      }
  }
  </code></pre>