I am working on an iOS application where I need to regularly “push” new levels on the device. The level is an HTML5 page with images, javascript and css files. I need all level files to be cached locally before the level can be played by the user. Each level is about 1.5 MB. I am going to archive the entire level folder with HTML, images, css and js in one zip archive, downloading this zip code and then unpacking it to the device. But maybe it is more efficient to download each file individually, because they can be downloaded at the same time?
This is my first iOS app, and I'm not quite sure how to do it right. Thus, the question arises: what is the best way to download the entire folder from the server asynchronously, and then start the callback when all files are downloaded (given that the user can close the application or lose the connection in the middle of the download)?
source
share