From a8885d044429e9a367dd4f682e5e0b09f66e3e76 Mon Sep 17 00:00:00 2001 From: Brent Simmons Date: Mon, 18 May 2026 16:24:30 -0700 Subject: [PATCH] Fix iOS crash on article disappear: don't animate showBars() in viewWillDisappear. --- iOS/Article/ArticleViewController.swift | 4 +++- iOS/Article/WebViewController.swift | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/iOS/Article/ArticleViewController.swift b/iOS/Article/ArticleViewController.swift index f02dae445..5d64e0230 100644 --- a/iOS/Article/ArticleViewController.swift +++ b/iOS/Article/ArticleViewController.swift @@ -219,7 +219,9 @@ final class ArticleViewController: UIViewController { endFind() searchBar.shouldBeginEditing = false } - currentWebViewController?.showBars() + // Pass animated: false — animating the nav bar / toolbar visibility change during the + // disappear transition triggers an Auto Layout assertion (NSISEngine) and crashes. + currentWebViewController?.showBars(animated: false) } override func viewSafeAreaInsetsDidChange() { diff --git a/iOS/Article/WebViewController.swift b/iOS/Article/WebViewController.swift index 24d5a1923..6e679ff75 100644 --- a/iOS/Article/WebViewController.swift +++ b/iOS/Article/WebViewController.swift @@ -216,13 +216,13 @@ final class WebViewController: UIViewController { loadWebView(replaceExistingWebView: true) } - func showBars() { + func showBars(animated: Bool = true) { AppDefaults.shared.articleFullscreenEnabled = false coordinator.showStatusBar() topShowBarsViewConstraint?.constant = 0 bottomShowBarsViewConstraint?.constant = 0 - navigationController?.setNavigationBarHidden(false, animated: true) - navigationController?.setToolbarHidden(false, animated: true) + navigationController?.setNavigationBarHidden(false, animated: animated) + navigationController?.setToolbarHidden(false, animated: animated) additionalSafeAreaInsets.bottom = 0 configureContextMenuInteraction() }