-[UICollectionViewLayout prepareForCollectionViewUpdates:] should be called before prepareLayout method

Originator:pitiphong.ph
Number:rdar://15922530 Date Originated:28-Jan-2014 12:29 PM
Status:Open Resolved:
Product:iOS SDK Product Version:7.0.3
Classification:Other Bug Reproducible:Always
 
Summary:
When collection view is updating data, -[UICollectionViewLayout prepareForCollectionViewUpdates:] should be called before prepareLayout and layoutAttributesForElementsInRect: method

Steps to Reproduce:
1. Subclass UICollectionViewLayout that is calculate the element layout attributes lazily.
2. Implement the update layout and data methods.
3. Manipulate the UICollectionView items.


Expected Results:
Method called on the subclass should be prepareForCollectionViewUpdates: -> prepareLayout -> layoutAttributesForElementsInRect:

Actual Results:
Method called on the subclass is prepareLayout -> layoutAttributesForElementsInRect: -> prepareForCollectionViewUpdates


Regression:
Describe circumstances where the problem occurs or does not occur, such as software versions and/or hardware configurations.

Notes:
I think prepareForCollectionViewUpdates: method is the best method for manipulate the layout attributes data when the collection view's items is updated. It let developer to implement the updating layout attributes for the updated data before the layout is asked for the newly showed attributes.

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!