Fix handoff to iPad/Mac modally presenting new screen rather than pushing nav

This commit is contained in:
Shadowfacts 2023-05-15 21:17:26 -04:00
parent 361ce456cf
commit 0ba38e4a3a
2 changed files with 12 additions and 2 deletions

View File

@ -115,6 +115,14 @@ class MainSplitViewController: UISplitViewController {
}
}
override func show(_ vc: UIViewController, sender: Any?) {
if traitCollection.horizontalSizeClass == .regular {
secondaryNavController.show(vc, sender: sender)
} else {
super.show(vc, sender: sender)
}
}
@objc func handleSidebarCommandTimelines() {
sidebar.select(item: .tab(.timelines), animated: false)
select(item: .tab(.timelines))

View File

@ -305,9 +305,11 @@ private class SplitSecondaryNavigationController: EnhancedNavigationViewControll
}
override func pushViewController(_ viewController: UIViewController, animated: Bool) {
super.pushViewController(viewController, animated: animated)
if viewControllers.isEmpty {
configureSecondarySplitCloseButton(for: viewController)
}
configureSecondarySplitCloseButton(for: viewControllers.first!)
super.pushViewController(viewController, animated: animated)
}
private func configureSecondarySplitCloseButton(for viewController: UIViewController) {