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

VLCEditController: Fill cell with VLCMLMedia

Soomin Lee 7 лет назад
Родитель
Сommit
3f7a8e080c
1 измененных файлов с 5 добавлено и 4 удалено
  1. 5 4
      Sources/VLCEditController.swift

+ 5 - 4
Sources/VLCEditController.swift

@@ -63,10 +63,11 @@ extension VLCEditController: UICollectionViewDataSource {
     func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
         if let cell = collectionView.dequeueReusableCell(withReuseIdentifier: VLCMediaViewEditCell.identifier,
                                                          for: indexPath) as? VLCMediaViewEditCell {
-            cell.titleLabel.text = "( `ー´)ノ"
-            cell.subInfoLabel.text = "(-ω-、)"
-            cell.sizeLabel.text = "|ω°•)"
-            cell.thumbnailImageView.image = UIImage(named: "vlc-xmas")
+            if let media = category.anyfiles[indexPath.row] as? VLCMLMedia {
+                cell.titleLabel.text = media.title
+                cell.subInfoLabel.text = media.formatDuration(ofMedia: media)
+                cell.sizeLabel.text = media.formatSize(ofMedia: media)
+            }
             return cell
         }
         return UICollectionViewCell()