CollectionView + UIKit Dynamics enhancements for performBatchUpdates:
| Originator: | george | ||
| Number: | rdar://15738549 | Date Originated: | 02-Jan-2014 03:52 PM |
| Status: | Open | Resolved: | |
| Product: | iOS SDK | Product Version: | 7.0+ |
| Classification: | Enhancement | Reproducible: | Always |
George Villasboas02-Jan-2014 03:52 PM
Summary:
Performing updates on a UICollectionView that makes use of UIKit Dynamics using performBatchUpdates: causes serious crashes if you simply just remove the UIKit Dynamics Behaviours and performBatchUpdates as we should on any other trivial UICollectionView update.
Crash messages:
2013-12-12 21:15:35.269 APPNAME[97890:70b] *** Assertion failure in -[UICollectionViewData validateLayoutInRect:], /SourceCache/UIKit_Sim/UIKit-2935.58/UICollectionViewData.m:357
2013-12-12 20:55:49.739 APPNAME[97438:70b] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UICollectionView recieved layout attributes for a cell with an index path that does not exist: <NSIndexPath: 0x975d290> {length = 2, path = 0 - 4}'
To fix the crash I have to manually iterate on the attributes updating manually all their NSIndexPaths and re-instantiate the UIDynamicAnimator.
There was a public claim for help on this matter on StackOverflow if interested on details: http://bit.ly/1lCDWDy
Also, a source code with the isolated problem is still available.
https://github.com/ghvillasboas/CollectionViewDynamics
Steps to Reproduce:
Expected Results:
UICollectionView's performBatchUpdates: should do all the internal attribute updates for the indexPaths and also avoid the need to re-instantiate the UIDynamicAnimator.
Actual Results:
Version:
Notes:
Configuration:
Attachments:
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!