title: Navigation bar disappears after the app comes to the foreground again
body: <p>I'm using <a href="https://github.com/rechsteiner/Parchment" rel="nofollow noreferrer">Parchment</a> to add menu items at the top. The hierarchy of the main view is the following:</p>
  <p>NavigationView
  -&gt; TabView
  --&gt; Parchment PagingView
  ---&gt; NavigationLink(ChildView)</p>
  <p>All works well going to the child view and then back again repeatedly. The issue happens when I go to ChildView, then go to the background/Home Screen then re-open. If I click back and then go to the child again the back button and the whole navigation bar disappears.</p>
  <p><a href="https://i.stack.imgur.com/eFIAO.gif" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/eFIAO.gif" alt="enter image description here" /></a></p>
  <p>Here's code to replicate:</p>
  <pre><code>import SwiftUI
  import Parchment
  
  @main
  struct ParchmentBugApp: App {
      var body: some Scene {
          WindowGroup {
              ContentView()
          }
      }
  }
  
  struct ContentView: View {
      var body: some View {
          NavigationView {
              TabView {
                  PagingView(items: [
                      PagingIndexItem(index: 0, title: &quot;View 0&quot;),
                  ]) { item in
                      VStack {
                          NavigationLink(destination: ChildView()) {
                              Text(&quot;Go to child view&quot;)
                          }
                      }
                      .navigationBarHidden(true)
                  }
              }
          }
      }
  }
  
  struct ChildView: View {
      var body: some View {
          VStack {
              Text(&quot;Child View&quot;)
          }
          .navigationBarHidden(false)
          .navigationBarTitle(&quot;Child View&quot;)
      }
  }
  </code></pre>
  <p>To replicate:</p>
  <ol>
  <li>Launch and go to the child view</li>
  <li>Click the home button to send the app to the background</li>
  <li>Open the app again</li>
  <li>Click on back</li>
  <li>Navigate to the child view. The nav bar/back button are not there anymore.</li>
  </ol>
  <p>What I noticed:</p>
  <ol>
  <li>Removing the <code>TabView</code> makes the problem go away.</li>
  <li>Removing <code>PagingView</code> also makes the problem go.</li>
  </ol>
  <p>I tried to use a custom PagingController and played with various settings without success. Here's the custom <code>PagingView</code> if someone would like to tinker with the settings as well:</p>
  <pre><code>struct CustomPagingView&lt;Item: PagingItem, Page: View&gt;: View {
      private let items: [Item]
      private let options: PagingOptions
      private let content: (Item) -&gt; Page
      
      /// Initialize a new `PageView`.
      ///
      /// - Parameters:
      ///   - options: The configuration parameters we want to customize.
      ///   - items: The array of `PagingItem`s to display in the menu.
      ///   - content: A callback that returns the `View` for each item.
      public init(options: PagingOptions = PagingOptions(),
                  items: [Item],
                  content: @escaping (Item) -&gt; Page) {
          self.options = options
          self.items = items
          self.content = content
      }
      
      public var body: some View {
          PagingController(items: items, options: options,
                           content: content)
      }
      
      struct PagingController: UIViewControllerRepresentable {
          let items: [Item]
          let options: PagingOptions
          let content: (Item) -&gt; Page
          
          func makeCoordinator() -&gt; Coordinator {
              Coordinator(self)
          }
          
          func makeUIViewController(context: UIViewControllerRepresentableContext&lt;PagingController&gt;) -&gt; PagingViewController {
              let pagingViewController = PagingViewController(options: options)
              return pagingViewController
          }
          
          func updateUIViewController(_ pagingViewController: PagingViewController, context: UIViewControllerRepresentableContext&lt;PagingController&gt;) {
              context.coordinator.parent = self
              if pagingViewController.dataSource == nil {
                  pagingViewController.dataSource = context.coordinator
              } else {
                  pagingViewController.reloadData()
              }
          }
      }
      
      class Coordinator: PagingViewControllerDataSource {
          var parent: PagingController
          
          init(_ pagingController: PagingController) {
              self.parent = pagingController
          }
          
          func numberOfViewControllers(in pagingViewController: PagingViewController) -&gt; Int {
              return parent.items.count
          }
          
          func pagingViewController(_: PagingViewController, viewControllerAt index: Int) -&gt; UIViewController {
              let view = parent.content(parent.items[index])
              return UIHostingController(rootView: view)
          }
          
          func pagingViewController(_: PagingViewController, pagingItemAt index: Int) -&gt; PagingItem {
              return parent.items[index]
          }
      }
  }
  </code></pre>
  <p>Tested on iOS Simulator 14.4 &amp; 14.5, and device 14.5 beta 2.</p>
  <p>Any tips or ideas are very much appreciated.</p>