forked from shadowfacts/Tusker
Don't construct unnecessary view controllers in MainSplitViewController
This commit is contained in:
parent
dfad8740eb
commit
67a029180e
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue