 
 
 class WYComposePictureViewCell: UICollectionViewCell {
+    //删除按钮执行的闭包
+    var deleteClickClosure: (() -> ())?
+    
     //通过外界传值设置image图片
     var image : UIImage? {
         

    
    func deleteButtonClick() {
        print("点击了删除")
    }
    
    

        let image = images[indexPath.item]
        //设置给cell
        cell.image = image
        
        //定义一个闭包
        cell.deleteClickClosure = {[weak self]
            () -> () in
            self?.images.remove(at: indexPath.item)
        //刷新数据
            self?.reloadData()
        }
        
        return cell
    }
    
