Parcourir la source

MediaCategoryViewController: Reload data on willAppear

The view should be prepared before it appears and not after.
Soomin Lee il y a 5 ans
Parent
commit
ee32d6dbe4
1 fichiers modifiés avec 1 ajouts et 5 suppressions
  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
     }