Просмотр исходного кода

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 лет назад
Родитель
Сommit
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)