소스 검색

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)