|
@@ -94,11 +94,18 @@ class GalleryViewController: UIViewController {
|
|
}
|
|
}
|
|
|
|
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
override func viewWillAppear(_ animated: Bool) {
|
|
|
|
+ // if would be better to reload on the corresponding events, see #1846
|
|
galleryItemCache = [:]
|
|
galleryItemCache = [:]
|
|
grid.reloadData()
|
|
grid.reloadData()
|
|
|
|
+
|
|
setupContextMenuIfNeeded()
|
|
setupContextMenuIfNeeded()
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ override func viewDidDisappear(_ animated: Bool) {
|
|
|
|
+ // user leaves view and may not come back soon: clearing cache may free a significant amount of memory
|
|
|
|
+ galleryItemCache = [:]
|
|
|
|
+ }
|
|
|
|
+
|
|
override func viewWillLayoutSubviews() {
|
|
override func viewWillLayoutSubviews() {
|
|
super.viewWillLayoutSubviews()
|
|
super.viewWillLayoutSubviews()
|
|
self.reloadCollectionViewLayout()
|
|
self.reloadCollectionViewLayout()
|