我是新的IOS,请考虑。我的问题是,每当我上传图像,它只是取代现有的图像。
现在我想上传唯一文件名的图像。我正在用照相机拍照。
func uploadtofirebase(){
let imagepath = UIImagePNGRepresentation(self.imagebutton.image!)
if imagepath == nil {
return
}
var strURL = "imagePickerController.png"
let storage = Storage.storage()
let storageRef = storage.reference().child("IosImages/").child(strURL)
print("calling here successfully ")
storageRef.putData(imagepath!, metadata:nil,completion:
{(metadata,error) in storageRef.downloadURL(completion: { (url, error) in
if let urlText = url?.absoluteString{
strURL = urlText
print("///////////tttttttt//////// \(strURL) ////////")
//completion(strURL)
print("passed activity")
self.startReceivingLocationChanges()
}
})
})
}
.child(strURL)
strURL
我必须让它充满活力。我已经做了安卓,但我不能做iOS。