Преглед на файлове

MediaCategoryViewController: Reload data on willAppear

The view should be prepared before it appears and not after.
Soomin Lee преди 5 години
родител
ревизия
ee32d6dbe4
променени са 1 файла, в които са добавени 1 реда и са изтрити 5 реда
  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
     }