title: Proper way to deal with cell reuse with background threads?
body: <p>I have a <code>UICollectionView</code>, but the same methods should apply to <code>UITableViews</code>. Each of my cells contains an image I load from disk, which is a slow operation. To mitigate this, I use an async dispatch queue. This works fine, but quickly scrolling results in these operations stacking up, such that the cell will change its image from one to another in sequence, until finally stopping at the last call. </p>
  
  <p>In the past, I've done a check to see if the cell was still visible, and if not I don't continue. However, this is not working with UICollectionView, and anyway it is not efficient. I am considering migrating to use <code>NSOperations</code>, which can be cancelled, so that only the last call to modify the cell will go through. I could possibly do this by checking if the operation had finished in the <code>prepareForReuse</code> method, and cancelling it if not. I'm hoping someone has dealt with this issue in the past and can provide some tips or a solution.</p>