类型“ StorageMetaData”的值没有成员SWIFT

时间:2018-07-19 22:39:41

标签: swift image firebase firebase-storage

现在,我尝试通过您发送给我的链接来回答问题。但是现在我得到一个新的错误代码 它说 使用未解决的标识符“ storageRef”

 func uploadProfileImage(_ image:UIImage, completion: @escaping ((_ url:URL?)->())) {
    guard let uid = Auth.auth().currentUser?.uid else { return }
    let starsRef = storageRef.child("images/stars.jpg")
    
    guard let imageData = UIImageJPEGRepresentation(image, 0.75) else { return }
    
    
    let metaData = StorageMetadata()
    metaData.contentType = "image/jpg"
    
    starsRef.downloadURL { url, error in
        if let error = error {
            // Handle any errors
        } else {
            // Get the download URL for 'images/stars.jpg'
        }
    }
        }

0 个答案:

没有答案