nayooti 5 năm trước cách đây
mục cha
commit
a43c8a4277
1 tập tin đã thay đổi với 2 bổ sung4 xóa
  1. 2 4
      deltachat-ios/View/Cell/GalleryCell.swift

+ 2 - 4
deltachat-ios/View/Cell/GalleryCell.swift

@@ -33,6 +33,7 @@ class GalleryCell: UICollectionViewCell {
 
     override func prepareForReuse() {
         super.prepareForReuse()
+        item?.onImageLoaded = nil
         item = nil
     }
 
@@ -51,17 +52,14 @@ class GalleryCell: UICollectionViewCell {
     }
 
     func update(item: GalleryItem) {
+        self.item = item
         item.onImageLoaded = { [weak self] image in
-            print("dc_debug: image set")
             self?.imageView.image = image
         }
         playButtonView.isHidden = !item.showPlayButton
-        self.item = item
         imageView.image = item.thumbnailImage
-
     }
 
-
     override var isSelected: Bool {
         willSet {
             // to provide visual feedback on select events