iOS9 implements a nice reordering feature for the UICollectionView.
At my CollectionViewController I implemented following code to get it work:
- (void)collectionView:(UICollectionView *)collectionView moveItemAtIndexPath:(NSIndexPath *)sourceIndexPath toIndexPath:(NSIndexPath *)destinationIndexPath
{
_cells[sourceIndexPath.row][1] = [NSString stringWithFormat:@"%li", (long)destinationIndexPath.row];
_cells[destinationIndexPath.row][1] = [NSString stringWithFormat:@"%li", (long)sourceIndexPath.row];
[self saveCellorder];
}
The 'cells' Array is just there to save the order of the Cells in the View
--
Now to my Problem/Question:
I got 2 different sized Cells in my CollectionView, when I drag a small cell over a small cell they change their places and everything is ok. Same happens when I drag a big cell over a big cell.
BUT when I drag a small cell over a big cell the big cell gets small and the small cell gets big. How can i prevent the cells from changing their size?