Layout Attributes are not applied correctly to a Collection View Cell after invalidating due to the preferred Layout Attributes

Originator:tobias.kraentzer
Number:rdar://19326615 Date Originated:22-Dec-2014 07:30 PM
Status:Open Resolved:
Product:iOS SDK Product Version:8.1.2 (12B440)
Classification: Reproducible:Always
 
Summary:
Using iOS8’s self-sizing cells in a custom collection view results to problems with applying the updated layout attributes after invalidating with an invalidation context.

This example demonstrates adding items to a collection view with batch updates. I would expect that the collection view applies the preferred layout attributes before starting the animation such that the items will be inserted with the default fade in (change of alpha). But somehow the updated layout attributes are applied to the cell while the insertion animation is already running.

Steps to Reproduce:
1. Run the sample app.
2. Touch the Add button (+)

Expected Results:
An cell with a multiline label (6 lines) should be fade in with the default insertion animation of the collection view.

Actual Results:
An cell is fade in with the estimated size (height 50) and after the animation updated with the preferred layout attributes (or not so often the preferred layout attributes are applied at the begin of the animation and the collection view animated to the attributes with the estimated height).

Version:
8.1.2 (12B440)

Notes:
Attached file contains a video and a demo project.

Demo project: https://github.com/anagromataf/SelfSizingCellsTest/releases/tag/1

The demo project contains a collection view controller with a custom layout that simulates a table like layout with self-sizing cells. The right button adds a new item to the collection (via a batch update), the left button removes all items (also via a batch update), and the middle button reloads the collection view with the current items.

Configuration:
iPhone 5s (Model A1457, A1518, A1528, A1530)

Attachments:
'Archiv.zip' was successfully uploaded.

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!