【发布时间】:2019-08-02 10:50:12
【问题描述】:
我正在尝试使用this 在我的项目中。但是当我尝试将选定的图像添加到我的 collectionView 时,它会给出一个错误,例如
“无法将 'TLPHAsset' 类型的值分配给类型 'UIImage?'”
在"行
cell.pic.image = selectedAssets[indexPath.item]
谁能帮我解决这个问题。谢谢。
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell : GalleryCollectionViewCell = collectionView.dequeueReusableCell(withReuseIdentifier: "GalleryCollectionViewCell", for: indexPath) as! GalleryCollectionViewCell
cell.pic.image = selectedAssets[indexPath.item]
// cell.pic.layer.cornerRadius = 15
return cell
}
【问题讨论】: