Pick the fix
In urlSession(_:downloadTask:didFinishDownloadingTo:), what must you do with the location URL?
Hint 1 of 1
How long does the temporary file exist?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Move the file to a permanent location before the method returns
Correct. The system deletes the temporary file afterwards.
Why not the others?
- B Save the URL and move the file later on the main queue. By then the temporary file is gone.
- C Read the whole file into Data and save it. Reading 2 GB into memory gets the app killed.
- D Leave it in the temporary directory. It will be deleted.