steipete/PSTCollectionView — pull request #275 by alexanderedge (2013-03-14 17:10:05+00:00)
Title: Delete item causes display corruption in flow layout

Hi Pete,

This pull request addresses #270. I've updated the example to use a more complicated data set which originally illustrated the problem.

The previous implementation would check if a given PSTCollectionViewItemKey is
present in the new visible views dictionary. This did not work for the following
case:

Item [0,0]
Item [0,1]
Item [0,2]

Deleting item at [0,1] should result in the alpha fade and eventual removal
from the superview and recycle, but actually since [0,1] is a valid index in the
new layout, [0,2] gets removed instead and [0,1] is faded.

This solution adds views that are to be deleted into a specific NSDictionary
that gets enumerated after all animations are finished. All views contained
inside are recycled.