Beginning Networking with URLSession, Episode 13: Challenge: Download Images | Kodeco, the new

Leverage the concepts learned in the previous lecture, but apply them towards downloading images corresponding to album artwork.

This is a companion discussion topic for the original entry at

Is it ok to use url) instead of url) and omit the check at the end? Or is there an advantage to safe the image first?

There should be no major difference between the two implementations.

You could call url), check the response first, and then attempt to save the image to temporary (or permanent) storage.

Alternatively, the video. uses url) which conveniently saves it for you to temporary storage along with providing the response to check how things went.

Both implementations are perfectly fine and should work the same, so whichever you prefer is ok :slight_smile:

1 Like