Quellcode durchsuchen

MediaCategoryViewController: Reload data on willAppear

The view should be prepared before it appears and not after.
Soomin Lee vor 5 Jahren
Ursprung
Commit
ee32d6dbe4
1 geänderte Dateien mit 1 neuen und 5 gelöschten Zeilen
  1. 1 5
      Sources/MediaCategories/MediaCategoryViewController.swift

+ 1 - 5
Sources/MediaCategories/MediaCategoryViewController.swift

@@ -167,6 +167,7 @@ class MediaCategoryViewController: UICollectionViewController, UICollectionViewD
         manager.presentingViewController = self
         cachedCellSize = .zero
         collectionView.collectionViewLayout.invalidateLayout()
+        reloadData()
     }
 
     @objc func themeDidChange() {
@@ -197,11 +198,6 @@ class MediaCategoryViewController: UICollectionViewController, UICollectionViewD
         ])
     }
 
-    override func viewDidAppear(_ animated: Bool) {
-        super.viewDidAppear(animated)
-        reloadData()
-    }
-
     func isEmptyCollectionView() -> Bool {
         return collectionView?.numberOfItems(inSection: 0) == 0
     }