mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Present SFSafariViewController using .overFullScreen instead of default .fullScreen — avoids a crash in -[UINavigationBar layoutSubviews]. Fix #4418.
This commit is contained in:
@@ -273,8 +273,7 @@ class WebViewController: UIViewController {
|
||||
if AppDefaults.shared.useSystemBrowser {
|
||||
UIApplication.shared.open(url, options: [:])
|
||||
} else {
|
||||
let vc = SFSafariViewController(url: url)
|
||||
present(vc, animated: true)
|
||||
openURLInSafariViewController(url)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -378,8 +377,7 @@ extension WebViewController: WKNavigationDelegate {
|
||||
guard didOpen == false else {
|
||||
return
|
||||
}
|
||||
let vc = SFSafariViewController(url: url)
|
||||
self.present(vc, animated: true)
|
||||
self.openURLInSafariViewController(url)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -794,11 +792,16 @@ private extension WebViewController {
|
||||
guard didOpen == false else {
|
||||
return
|
||||
}
|
||||
let vc = SFSafariViewController(url: url)
|
||||
self.present(vc, animated: true)
|
||||
self.openURLInSafariViewController(url)
|
||||
}
|
||||
}
|
||||
|
||||
func openURLInSafariViewController(_ url: URL) {
|
||||
|
||||
let viewController = SFSafariViewController(url: url)
|
||||
viewController.modalPresentationStyle = .overFullScreen // This avoids a crash with .fullScreen
|
||||
present(viewController, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: Find in Article
|
||||
|
||||
@@ -676,6 +676,7 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
|
||||
if let indexPath = coordinator.currentFeedIndexPath,
|
||||
let url = coordinator.homePageURLForFeed(indexPath) {
|
||||
let vc = SFSafariViewController(url: url)
|
||||
vc.modalPresentationStyle = .overFullScreen
|
||||
present(vc, animated: true)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user