Fix crash caused by reloading visible cells when they didn't need to be

This commit is contained in:
Maurice Parker committed 2021-10-21 09:33:29 -05:00
1 parent 278e845f76
commit a990888be7
1 file changed
+5 -3
@@ -87,9 +87,11 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
}
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
IconImageCache.shared.emptyCache()
super.traitCollectionDidChange(previousTraitCollection)
reloadAllVisibleCells()
if traitCollection.preferredContentSizeCategory != previousTraitCollection?.preferredContentSizeCategory {
IconImageCache.shared.emptyCache()
super.traitCollectionDidChange(previousTraitCollection)
reloadAllVisibleCells()
}
}
// MARK: Notifications