实例成员'jpegData'不能用于'UIImage'类型。我尝试了几种解决方案,但没有任何效果

时间:2018-12-15 02:51:16

标签: ios swift xcode

编码新手,会在jpegData行上不断出现此错误,并且不知道为什么会出错。谢谢

if let imgData = UIImage.jpegData(compressionQuality:0.2) {
            let imgUid = NSUUID().uuidString

            let metadata = StorageMetadata()
            metadata.contentType = "image/jpeg"
            Storage.storage().reference().child(imgUid).put(imgData, metadata: metadata) { (metadata, Error) in
                if error != nil {
                    print("Did not upload image")

0 个答案:

没有答案