diff --git a/Tusker/Screens/Main/MainSidebarViewController.swift b/Tusker/Screens/Main/MainSidebarViewController.swift index cdb0980f..c111cdeb 100644 --- a/Tusker/Screens/Main/MainSidebarViewController.swift +++ b/Tusker/Screens/Main/MainSidebarViewController.swift @@ -95,6 +95,8 @@ class MainSidebarViewController: UIViewController { } func select(item: Item, animated: Bool) { + // ensure view is loaded, since dataSource is created in viewDidLoad + loadViewIfNeeded() guard let indexPath = dataSource.indexPath(for: item) else { return } collectionView.selectItem(at: indexPath, animated: animated, scrollPosition: .top) itemLastSelectedTimestamps[item] = Date()