title: Hide navigation bar without losing swipe back gesture in SwiftUI
body: <p>In SwiftUI, whenever the navigation bar is hidden, the swipe to go back gesture is disabled as well.  </p>
  
  <p>Is there any way to hide the navigation bar while preserving the swipe back gesture in SwiftUI? I've already had a custom "Back" button, but still need the gesture. </p>
  
  <p>I've seen some solutions for UIKit, but still don't know how to do it in SwiftUI</p>
  
  <p>Here is the code to try yourself:</p>
  
  <pre><code>import SwiftUI
  
  struct RootView: View {
      var body: some View {
          NavigationView {
              NavigationLink(destination: SecondView()) {
                  Text("Go to second view")
              }
          }
      }
  }
  
  struct SecondView: View {
      var body: some View{
          Text("As you can see, swipe to go back will not work")
          .navigationBarTitle("")
          .navigationBarHidden(true)
      }
  }
  </code></pre>
  
  <p>Any suggestions or solutions are greatly appreciated</p>