I need to upload large number of photos to a server from my iOS device. For example, 500 photos. How should I do this right?
I created upload task with background session configuration with NSURLSession for each photo. I tried making my own custom queue where each next task would launch after completion of previous one. But at one moment new task wasn't starting. I guess, because it all was happening in the background. More on this issue, you can read here
(If approach with a queue was right, would you please advise a good realisation of a queue for async tasks, because I may messed up something in my implementation)
So after article linked above, my guess was I should start all upload tasks at once (not one after another). But I have efficiency concern. If I would create a task for each photo, it would 500 background async task and about 1 gigabyte of a data uploading parallel. I guess, it would cause some problem with network.
To sum up all said above, which is the right way to upload large piece of data in background in iOS (500 photos in my case)?