I am developing an ios app with AWS Amplify supporting my backend. I am able to upload files to S3 but I can't seem to find any documentation on how to cancel a currently executing upload (documentation here). Please can someone advise?
This is what I use to upload:
import UIKit
import AWSAppSync
import Amplify
import AWSMobileClient
import AmplifyPlugins
let dataString = "My Data"
let data = dataString.data(using: .utf8)!
Amplify.Storage.uploadData(key: "ExampleKey", data: data,
progressListener: { progress in
print("Progress: \(progress)")
}, resultListener: { event in
switch event {
case .success(let data):
print("Completed: \(data)")
case .failure(let storageError):
print("Failed: \(storageError.errorDescription). \(storageError.recoverySuggestion)")
})
})