浏览代码

MediaCategoryViewController: Update EditToolbar actions dynamically

In the case where the user imported media files when there
wasn't any and the view was in edit mode. The edit toolbar actions
wasn't updated dynamically.

Indeed the user had to go out and back to the edit mode to have the
toolbar updated.

This will make sure that the toolbar is updated dynamically.
Soomin Lee 5 年之前
父节点
当前提交
4e6181d19c
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      Sources/MediaCategories/MediaCategoryViewController.swift

+ 6 - 0
Sources/MediaCategories/MediaCategoryViewController.swift

@@ -173,6 +173,12 @@ class MediaCategoryViewController: UICollectionViewController, UISearchBarDelega
         if !isSearching {
             popViewIfNecessary()
         }
+
+        if isEditing {
+            if let editToolbar = tabBarController?.editToolBar() {
+                editToolbar.updateEditToolbar(for: model)
+            }
+        }
     }
 
     @available(*, unavailable)