Why prepareForReuse()?

override func prepareForReuse() {
    super.prepareForReuse()
    downloadTask?.cancel()
    downloadTask = nil
    nameLabel.text = nil
    artistNameLabel.text = nil
    artworkImageView.image = nil
}

The recycled cell will be configured for the new row when being re-used anyway. So why bother clear the old infomation on it? it will be “overwritten” at the end.

The downloadTask?.cancel() might be appropriate for the function, but you are correct in that Apple does not recommend manually resetting any of the cell data unless it is unrelated to the content.

From Apple:

For performance reasons, you should only reset attributes of the cell that are not related to content, for example, alpha, editing, and selection state. The table view’s delegate in tableView:cellForRowAtIndexPath: should always reset all content when reusing a cell.

That being said, due to this being part of iOS Apprentice, it might be here to provide a simple example of the usage of prepareForReuse() so that the learner can explore other ways to use it later. It might be helpful, if this is the case, for the text of the book to highlight this.