I am using dispatch queue to manage a series of background tasks (download multiple files on user's demand and without waiting in UI) and so far it worked great. More over I need to persistent the unfinished tasks, so for example if there is no network reach-ability, or the app crashed, or phone's battery dead, next time when the app run, all tasks will resume automatically.
I am planning to make each task block save the task in a core data context, and remove it once the task is finished, and also I will need to perform a check when app start to see if there is any task to do.
What's the best practice of creating this sort of application? Is there any sample, tutorial or library that I can reuse?