Hi Polyphonic, thanks so much for the quick reply.
Yes, I do just that. I store the URL from aggregateAssetDownloadTask:willDownloadTo and try to generate a bookmark from it on cancel. The only difference is, in my project I don't use UserDefaults for storage.
My sequence is -> Store the URL, report progress to the UI.
On Cancel -> Cancel Task -> Receive Delegate callback -> General cleanup which also involves deleting the asset by constructing a bookmark.
let url = try URL(resolvingBookmarkData: localURL,
bookmarkDataIsStale: &bookmarkDataIsStale)
try FileManager.default.removeItem(at: url)
I very often see the partial downloads remain on the device.
Post
Replies
Boosts
Views
Activity
Thank you @eskimo :) Here is the link: https://forums.swift.org/t/consuming-an-asyncstream-from-multiple-tasks/54453/7