From 67a029180e2b6661a8310f09ceefa56abd9b7897 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sun, 15 Nov 2020 19:04:46 -0500 Subject: [PATCH] Don't construct unnecessary view controllers in MainSplitViewController --- Tusker/Screens/Main/MainSplitViewController.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tusker/Screens/Main/MainSplitViewController.swift b/Tusker/Screens/Main/MainSplitViewController.swift index cc9555235b..a66a0c45c7 100644 --- a/Tusker/Screens/Main/MainSplitViewController.swift +++ b/Tusker/Screens/Main/MainSplitViewController.swift @@ -53,7 +53,11 @@ class MainSplitViewController: UISplitViewController { primaryBackgroundStyle = .sidebar setViewController(EnhancedNavigationViewController(), for: .secondary) - select(item: .tab(.timelines)) + // don't unnecesarily construct a content VC unless the we're in actually split mode + // when we change from compact -> split for the first time, the VC will be transferred anyways + if traitCollection.horizontalSizeClass != .compact { + select(item: .tab(.timelines)) + } tabBarViewController = MainTabBarViewController(mastodonController: mastodonController) setViewController(tabBarViewController, for: .compact)