Closed ysakurada closed 4 years ago
Hey ysakurada,
Thank you for pointing that out. There were two things that was wrong, Sample should be:
var cancelBag = Set<AnyCancellable>()
func uplodTask() {
let someBucket = "some_bucket"
let reference = Storage.storage()
.reference(forURL: "\(someBucket)/images/space.jpg")
if let fileURL = URL(string:"some") {
let uploadTask = reference.putFile(from: fileURL)
uploadTask.publisher(.progress)
.sink(receiveCompletion: { _ in
// error will never call here
print("๐ finished")
}) { (snapshot) in
if let error = snapshot.error {
print("error: \(error)")
}
let percentComplete = 100.0 * Double(snapshot.progress?.completedUnitCount ?? 0) / Double(snapshot.progress?.totalUnitCount ?? 1)
}.store(in: &cancelBag)
}
}
Also method publisher(_ status:) was not public, source of library. I updated that in version 0.2.4. Please update using: pod update
Thank you for fixing bug๐ And Giving new sample code๐
This repository make helpful for everyone๐๐Like!
Thank for uploading this repository. I used sample code this and get this error.
'Generic parameter 'Value' could not be inferred'
Did you get this kind of error? And This code need 'break' after 'case .failure(let error)'.๐