Преглед изворни кода

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
     }