소스 검색

fix title

marinofaggiana 4 년 전
부모
커밋
a15eb239b4
1개의 변경된 파일7개의 추가작업 그리고 3개의 파일을 삭제
  1. 7 3
      iOSClient/Media/NCMedia.swift

+ 7 - 3
iOSClient/Media/NCMedia.swift

@@ -138,9 +138,13 @@ class NCMedia: UIViewController, DropdownMenuDelegate, DZNEmptyDataSetSource, DZ
     
     func mediaCommandTitle() {
         mediaCommandView?.title.text = ""
-        if let cell = collectionView?.visibleCells.first as? NCGridMediaCell {
-            if cell.date != nil {
-                mediaCommandView?.title.text = CCUtility.getTitleSectionDate(cell.date)
+        
+        if let visibleCells = self.collectionView?.indexPathsForVisibleItems.sorted(by: { $0.row < $1.row }).compactMap({ self.collectionView?.cellForItem(at: $0) }) {
+        
+            if let cell = visibleCells.first as? NCGridMediaCell {
+                if cell.date != nil {
+                    mediaCommandView?.title.text = CCUtility.getTitleSectionDate(cell.date)
+                }
             }
         }
     }