首页 > 解决方案 > SDWebImage 不适用于 Firebase 存储

问题描述

我已经阅读了很多关于 SDWebImage 和 Firebase 问题的帖子,但似乎没有一个能解决我的问题。我正在尝试在我的 collectioniionView 单元格中显示来自 Firebase 存储的图像:

    override func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
    let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) as! BildeKatCell

    let someUrl = URL(string: "url to one random firebase storage image")
    cell.imageView.sd_setImage(with: someUrl, completed: nil)
    return cell
}

我已经用我最终想要使用的所有图像中的 url 创建了一个数组,但是即使使用硬编码的 url,我也无法在我的单元格中显示图像。我已经尝试了所有不同的 sd_setimage 方法,我还尝试在普通 viewController 中使用单个 imageView 执行完全相同的操作,但我仍然一无所获。不明白我错过了什么。

标签: iosswiftfirebasesdwebimage

解决方案


推荐阅读