浏览代码

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
     }