我正在使用AWSLocal
内容上传方法上传文件.我需要取消从其他屏幕上传.
这是上传功能:
private func uploadLocalContent(localContent: AWSLocalContent) {
localContent.uploadWithPinOnCompletion(false, progressBlock: {[weak self](content: AWSLocalContent?, progress: NSProgress?) -> Void in
guard let strongSelf = self else { return }
dispatch_async(dispatch_get_main_queue()) {
// Update the upload UI if it is a new upload and the table is not yet updated
if(strongSelf.tableView.numberOfRowsInSection(0) == 0 || strongSelf.tableView.numberOfRowsInSection(0) < strongSelf.manager.uploadingContents.count) {
strongSelf.updateUploadUI()
} else {
for uploadContent in strongSelf.manager.uploadingContents {
if uploadContent.key == content?.key {
let index = strongSelf.manager.uploadingContents.indexOf(uploadContent)!
let indexPath = NSIndexPath(forRow: index, inSection: …
Run Code Online (Sandbox Code Playgroud)