🚑Fixes #4483 by showing bars on rotation

On rotation, if the device is a .phone and it is transitioning to a `.regular` horizontal size class—it’s big—bars in the article view are surfaced to workaround a crash. This doesn’t affect behaviour on smaller iPhones or iPads.
This commit is contained in:
Stuart Breckenridge
2025-01-13 12:16:13 +08:00
parent 8229e31f4f
commit c44bdbed46

View File

@@ -189,6 +189,14 @@ class ArticleViewController: UIViewController {
view.layoutIfNeeded()
}
override func willTransition(to newCollection: UITraitCollection, with coordinator: any UIViewControllerTransitionCoordinator) {
// We only want to show bars when rotating to horizontalSizeClass == .regular
// (i.e., big) iPhones to resolve crash #4483.
if UIDevice.current.userInterfaceIdiom == .phone && newCollection.horizontalSizeClass == .regular {
currentWebViewController?.showBars()
}
}
func updateUI() {
guard let article = article else {