I have collectionView with two custom layouts, if some action happens I'm removing two items from data source and trying to set different collection view
[self.tabCollectionView setCollectionViewLayout:self.basicFlowLayout animated:NO];
I'm getting error:
*** Assertion failure in -[UICollectionViewData validateLayoutInRect:], /SourceCache/UIKit_Sim/UIKit-2935.137/UICollectionViewData.m:357
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView recieved layout attributes for a cell with an index path that does not exist: <NSIndexPath: 0xbcecd60> {length = 2, path = 0 - 4}'
However when I do that after removing only one item, animation works well. Also there is no problems on iOS 7. Struggling with this whole day and can't find proper solution to fix it. Any ideas?