Is it safe and does it make sense to defer an asynchronous image download for a cell? The idea behind this is that I want the callback function from URLSession.shared.image(...) to be executed after creating the cell and only once calling cellForRow(at: indexPath) is valid, since I think that without deferring this method at this point should return nil.

* URLSession.shared.image is a private extension that runs a data task and gives a escaping callback only if the url provided in the argument is valid and contains an image.
* setImage(image:animated) is a private extension that allows you to set an image in a UIImageView using a simple animation.

If defer is not the way to go, please indicate an alternative.

Any feedback is appreciate, thanks!

```
override func tableView(_ tableView: UITableView, cellForRowAt
    indexPath: IndexPath) -> UITableViewCell {

    let cell = baseCell as! MyCell
    let datum = data[indexPath.row]
    cell.imageView.setImage(placeholderImage, for: .normal)

    defer {
        URLSession.shared.image(with: datum.previewURL) { image, isCached in
            if let cell = tableView.cellForRow(at: indexPath) as? MyCell {
                cell.imageView.setImage(image, animated: !isCached)
            }
        }
    }

    return cell
}

```