0

Using SwiftyDropbox download method to download all files. But, i found progress block showing data all together of different files, not downloading files in a way that downloading of one file start after completing the previous one.

Here, is the code used :

DropboxClientsManager.authorizedClient?.files
   .download(path: entry.pathLower!, overwrite: true, destination: destination)
   .response { response, error in
                                
       if let response = response {
           print(response)
       }
       else if let error = error {
           print(error)      
       }
   }
   .progress { progressData in
       print(progressData)                
   }
New Dev
  • 48,427
  • 12
  • 87
  • 129
  • You’re going to pay a significant performance penalty if you download them sequentially. Are you trying to update individual progress indicators or one for all of them? – Rob Apr 03 '21 at 17:16
  • API calls like `.download` in the Dropbox Swift SDK will run asynchronously, so if you run the above code multiple times, each file may begin downloading before the previous one(s) finished. You can run them one at a time if you wish, but there will be some performance considerations in doing so, as Rob mentioned. There are multiple ways you could implement that. You may want to look into queues or semaphores. – Greg Apr 05 '21 at 15:42

0 Answers0