UICollectionViewFlowLayout movement has incorrect sizing behavior

Originator:steipete
Number:rdar://25235882 Date Originated:18-Mar-2016 09:26 AM
Status:Open Resolved:
Product:iOS Product Version:9.2.1
Classification:UI/Usability Reproducible:Always
 
This is a duplicate of rdar://25235459

Summary:
When interactively moving cells around, the collection view flow layout keeps asking the delegate for `collectionView:layout:sizeForItemAtIndexPath:` with the index paths for the current UI representation. This results in cells jumping in size while one cell is being moved.

Steps to Reproduce:
- Open the sample project
- Run the sample project
- Tap and hold on one cell for 0.5 secs
- Drag that cell around for reordering.

Expected Results:
All cells remain in their initial size and move along the screen.

Actual Results:
Cells jump in size whenever there are cells of different size involved.

Regression:
This can be fixed by implementing `collectionView:targetIndexPathForMoveFromItemAtIndexPath:toProposedIndexPath:` and keeping track of the current movement. With that information one can do a mapping inside the `collectionView:sizeForItemAtIndexPath:` method and return the correct size. However other delegate methods like `collectionView:cellForItemAtIndexPath:` do not require this mapping as new cells enter the screen while moving objects around. So that definitely does not look like the intended approach.

Notes:
Sample project: https://github.com/michaelochs/radars/tree/master/25235459%20-%20CollectionViewMovementSizing

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!