使用 FirebaseStorageUI + SDWebImage 时出错

Error when using FirebaseStorageUI + SDWebImage

我已经尝试解决这个问题几个小时了,但似乎没有任何效果。

我想使用 FirebaseStorageUI 和 SDWebImage 在 uitableviewcell 上显示图像。我使用 this 教程作为参考(请参阅该网站上的 "Downloading Images with FirebaseUI" 部分)。

这是我的代码在 tableview willDisplay 单元格上的样子:

override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
    let cell = cell as! CategoryCell
    let title = categoriesData[indexPath.row].name

    let refTest = FIRStorage().reference().child("images/categories/testImage.jpg")
    cell.bgImageView.sd_setImage(with: refTest, placeholderImage: #imageLiteral(resourceName: "placeholderImg")) {(image, error, cacheType, storageRef) in
        if let error = error {
            print("error downloading image: \(error)")
        }
    }
    cell.bgImageView.alpha = 0.5
    cell.titleLabel.text = title
}

这是错误消息:

error downloading image: Error Domain=FIRStorageErrorDomain Code=-13040 "User cancelled the upload/download." UserInfo={NSLocalizedDescription=User cancelled the upload/download.}

我做错了什么?

FIRStorage之后添加.storage()

应该是这样的:

let refTest = FIRStorage.storage().reference().child("images/categories/testImage.jpg")