Fix crash on launch due to unloaded sidebar VC
This commit is contained in:
parent
260bedcf10
commit
f9b85c87b4
|
@ -98,6 +98,9 @@ extension MainSplitViewController: UISplitViewControllerDelegate {
|
||||||
}
|
}
|
||||||
|
|
||||||
func splitViewControllerDidCollapse(_ svc: UISplitViewController) {
|
func splitViewControllerDidCollapse(_ svc: UISplitViewController) {
|
||||||
|
// on iPhones, the sidebar VC is never loaded, but since this method is still called, we can't do anything
|
||||||
|
guard sidebar.isViewLoaded else { return }
|
||||||
|
|
||||||
// Transfer the nav stacks for all the sidebar items that map 1 <-> 1 with tabs
|
// Transfer the nav stacks for all the sidebar items that map 1 <-> 1 with tabs
|
||||||
for tab in [MainTabBarViewController.Tab.timelines, .notifications, .myProfile] {
|
for tab in [MainTabBarViewController.Tab.timelines, .notifications, .myProfile] {
|
||||||
let tabNav = tabBarViewController.viewController(for: tab) as! UINavigationController
|
let tabNav = tabBarViewController.viewController(for: tab) as! UINavigationController
|
||||||
|
|
Loading…
Reference in New Issue