THSpringyCollectionView
THSpringyCollectionView copied to clipboard
reloadData doesnt always work
reloadData doesnt show new data. My example works fine with flowlayout but not with this library.
I agree, this library doesn't work when you change your datasource. The reason for that is that _animator 's behavior and _visibleIndexPaths are not reseted completely in prepareLayout. For performance purpose, the developer chose to add only new visible cells and remove those that where not visible. You have to implement a reset method that empty both _ animator and _visibleIndexPaths and call this method on yout layout each time you need to call a reloadData on your collection view. I hope I'm clear.
I just call this method and it works ! thanks !
-(void)resetLayout
{
[_animator removeAllBehaviors];
[_visibleIndexPaths removeAllObjects];
}