|
Ran
|
Jobs
1
|
Files
0
|
Run time
–
|
Badge
README BADGES
|
push
travis-ci
Prevent stale adapter:collectionView corruptions Summary: This becomes an issue pretty easily in embedded `IGListAdapter` environments (lists in lists). IGListKit creates a single `IGListSectionController` instance per object, but cells are reused within `IGListCollectionView`. If you assign `adapter.collectionView = cell.collectionView` (like we recommend in our [example](https://github.com/Instagram/IGListKit/blob/master/Examples/Examples-iOS/IGListKitExamples/SectionControllers/HorizontalSectionController.swift#L40)), then you can have many adapters with a weak ref to the **same collection view**. Obviously when updates happen across all embedded lists, adapters could potentially update the same collection view and apply a corrupted batch update. I proposed using `<objc/runtime.h>` and using associated objects, but since `OBJC_ASSOCIATION_ASSIGN` is not zerod-on-release reference (its just `unsafe_unretained`) I'd have to make a weak wrapped object, which is overkill. Instead I think a global weak:weak map is fine. We d Closes https://github.com/Instagram/IGListKit/pull/517 Differential Revision: D4623300 Pulled By: rnystrom fbshipit-source-id: 53d2dd158