I was trying to implement the pause/resume feature in the apple sample code https://developer.apple.com/library/prerelease/content/samplecode/HLSCatalog/Introduction/Intro.html#//apple_ref/doc/uid/TP40017320
I'm able to pause the AVAssetDownloadTask using suspend() method and resume it back using resume() method.
But this pause/resume will work only two times. When I pause 3rd time I'm not able to resume it back. And I cannot start a new asset download after this.
I need to reboot the device to start download again.
I'm using the below code to do pause/resume (in the above sample code)
if task?.state == .running {
task?.suspend()
}
else if task?.state == .suspended {
task?.resume()
}