My app needs to download a batch of files with the following requirements:
- The batch should be processed somewhat in order (never at the expense of downloading files simultaneously).
- Downloads should continue in background if the app is closed.
- The user might trigger other downloads at any time. These downloads should have priority over the batch.
- Given that the user might trigger the download of any file in the batch, if a file is already downloaded, it shouldn't be downloaded again. I should be able to check if the file is already downloaded before starting the actual download, or remove it from the queue.
This can certainly be achieved with a lot of boilerplate code (too much to post here). What would be the simplest way to do this with iOS 7 brand new NSURLSession
and/or AFNetworking 2.0?