有没有办法判断Dropbox块上传提交是否成功?

时间:2015-06-04 20:52:40

标签: ios swift dropbox-api

在块上传结束时,我使用以下命令提交文件:

self.restClient.uploadFile(filename, toPath: destDir, withParentRev: nil, fromUploadId: uploadId)

这次提交会失败吗?是否存在此方法返回时运行的成功或错误方法?

1 个答案:

答案 0 :(得分:1)

€dited:您可以使用几种委托方法

    func restClient(client: DBRestClient!, loadedFile destPath: String!, contentType: String!, metadata: DBMetadata!) {
        NSLog("File DOWNLOADED successfully to path: %@", destPath);
    }

    func restClient(client: DBRestClient!, loadFileFailedWithError error: NSError!) {
        NSLog("File DOWNLOAD failed with error: %@", error)
    }

    func restClient(client: DBRestClient!, uploadFileFailedWithError error: NSError!) {
        NSLog("File UPLOAD failed with error: %@", error)
    }