title: Hide navigation bar in iOS16 + xcode 14 beta not working
body: <p>We use Firebase's Crashlytics and in the last 2 days we've seen a spike in crashes with <strong>navigationController?.setNavigationBarHidden</strong> on iOS 16 devices. I was able to reproduce the crash after installing Xcode 14.5</p>
  <p>I have a view controller (VC1) embedded in a navigational controller with the following code in</p>
  <pre><code>override func viewWillDisappear(_ animated: Bool) {
    super.viewWillDisappear(animated)
    ...
    navigationController?.setNavigationBarHidden(false, animated: animated) // crash here
  }
  </code></pre>
  <p>and after I push another view controller (VC2) using the following code</p>
  <pre><code>navigationController?.pushViewController(vc, animated: true)
  </code></pre>
  <p>the app crashes with the following error message</p>
  <blockquote>
  <p>2022-08-10 15:07:04.866752-0700 autolist-dev[22341:3295980] *** Terminating app due to uncaught exception 'NSGenericException', reason: 'Unable to activate constraint with anchors &lt;NSLayoutXAxisAnchor:0x600001a9d740 &quot;_UITAMICAdaptorView:0x7fd6c70ddbe0.leading&quot;&gt; and &lt;NSLayoutXAxisAnchor:0x600001466680 &quot;_UINavigationBarTitleControl:0x7fd6c70dcb80.leading&quot;&gt; because they have no common ancestor.  Does the constraint or its anchors reference items in different view hierarchies?  That's illegal.'</p>
  </blockquote>
  <p>It doesn't immediately crash the first time VC2 is pushed. After I go back to VC1 and then push VC2 again then the app crashes.</p>
  <p>Does anyone have any ideas on how to resolve this? I can't seem to find anyone else having a similar issue</p>