Kaynağa Gözat

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 yıl önce
ebeveyn
işleme
4e6181d19c

+ 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)