为什么从不调用代码块?

时间:2017-12-01 12:09:05

标签: ios swift firebase firebase-storage

我可以将照片放到Firebase存储中:

func SendAdvertisesToFireBase(_ data: SkelbimasModel) {
    var links = [String]()
    for image in data.nuotraukos {
        print(image)
        if let uploadData = UIImagePNGRepresentation(image) {
            //let imageNames = NSUUID().uuidString
            let store = Storage.storage().reference().child("images").child("image.png")
            store.putData(uploadData, metadata: nil, completion: { (metadata, error) in
                if (error != nil) {
                    print(error as Any)
                    print("nepaejo")
                    return
                }
                print("paejo")
                let address = metadata?.downloadURL()?.absoluteString
                links.append(address!)
            })
        }
    }
    self.AddDataAfterImageAdded(self.skelbimas, links)
}

print(image)打印图像。

调试器中的

let store =Storage.storage().reference().child("images").child("image.png"显示有一个引用,但未调用store.putData(...)。我没有错误。

0 个答案:

没有答案