Comments (3)
Yes you can limit concurrent downloads. For example see the code sample below:
let ongoingTasks = mzDownloadingViewObj?.downloadManager.downloadingArray.filter({ (fileModel: MZDownloadModel) -> Bool in
return fileModel.status == TaskStatus.downloading.description()
})
if (ongoingTasks?.count)! <= 5 {
mzDownloadingViewObj?.downloadManager.addDownloadTask(fileName as String, fileURL: fileURL.addingPercentEscapes(using: String.Encoding.utf8.rawValue)!, destinationPath: myDownloadPath)
}
When some task is finished it will call the delegate and you can add new task there.
More over you can use the fileURL property. Every file on your server must have unique url.
from mzdownloadmanager.
what if I need to download a bunch of files?
Yes you can download multiple files simultaneously. You can use the instance method addDownloadTask
to add a task.
I don't know how many files I have to download, it depends on the server
You can add as many as tasks you want but it is recommended to apply some limit on running tasks.
I'd like to be able to track the download of every single file understanding when it finished
MZDownloadManager provides different delegate methods to inform about any event, check the docs or source.
from mzdownloadmanager.
You can add as many as tasks you want but it is recommended to apply some limit on running tasks.
Is not possible to limit the number of concurrent downloads in some way? Is there maybe a var?
MZDownloadManager provides different delegate methods to inform about any event, check the docs or source.
Yes, I saw them, but it's impossible to handle the downloads using the index var because often the index has the same value for multiple resources. How can I avoid this?
from mzdownloadmanager.
Related Issues (20)
- Php Tag
- Multiple download files task called asynchronously
- How can I check the progress of downloading one file?
- Retry download does not work. Swift 3
- Why I force quit APP, the resume download from zero HOT 4
- When download in iOS 10.3.1, the cpu and memory were very high
- Having issues when downloading over fast network on slow devices HOT 2
- Stuck on pending HOT 1
- Cannot use in objc project.
- Download 3 file at same time HOT 1
- Download File Size HOT 1
- SSL Error HOT 2
- while i update xcode 10.1 with swift 4.2,have find errors such as Value of type 'MZDownloadModel' has no member 'id',Value of type 'MZDownloadManager' has no member 'clearAllDownloads' and Value of type 'MZDownloadManager' has no member 'isAnyDownloadTasks'
- Issue on MZDownloadManager.swift isValidResumeData line 156 HOT 11
- Downloding array is clear when app start again after complete all download
- Delegates are not calling after come back from background HOT 3
- Divide By Zero Exception
- Some url working fine on browser but this manager not find HOT 1
- File already exist HOT 2
- swift too many HTTP redirects HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mzdownloadmanager.