From ab3bad0e160c1de93e6b20d5b77f04c4c3e4609b Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 4 Feb 2023 13:48:24 -0500 Subject: [PATCH] Fix trending statuses not being deselected on navigation back --- .../Screens/Explore/TrendingStatusesViewController.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Tusker/Screens/Explore/TrendingStatusesViewController.swift b/Tusker/Screens/Explore/TrendingStatusesViewController.swift index 86a572a1..e3a6201e 100644 --- a/Tusker/Screens/Explore/TrendingStatusesViewController.swift +++ b/Tusker/Screens/Explore/TrendingStatusesViewController.swift @@ -9,13 +9,13 @@ import UIKit import Pachyderm -class TrendingStatusesViewController: UIViewController { +class TrendingStatusesViewController: UIViewController, CollectionViewController { weak var mastodonController: MastodonController! let filterer: Filterer - private var collectionView: UICollectionView { - view as! UICollectionView + var collectionView: UICollectionView! { + view as? UICollectionView } private var dataSource: UICollectionViewDiffableDataSource! @@ -110,6 +110,8 @@ class TrendingStatusesViewController: UIViewController { override func viewWillAppear(_ animated: Bool) { super.viewWillAppear(animated) + clearSelectionOnAppear(animated: animated) + if !loaded { loaded = true var snapshot = NSDiffableDataSourceSnapshot()