VegaScroll icon indicating copy to clipboard operation
VegaScroll copied to clipboard

UICollectionViewFlowLayout has cached frame mismatch for index path

Open OptTrader opened this issue 7 years ago • 1 comments

I got this message when I added and ran a test project:

UICollectionViewFlowLayout has cached frame mismatch for index path <NSIndexPath: 0xc000000000000016> {length = 2, path = 0 - 0} - cached value: {{20, 10.083407407407407}, {374, 84}}; expected value: {{20, 10}, {374, 84}} This is likely occurring because the flow layout subclass Coin.VegaScrollFlowLayout is modifying attributes returned by UICollectionViewFlowLayout without copying them.

Any idea how to fix this? The one solution I found didn't work:

override func finalLayoutAttributesForDisappearingItemAtIndexPath(itemIndexPath: NSIndexPath) -> UICollectionViewLayoutAttributes? { let attr = self.layoutAttributesForItemAtIndexPath(itemIndexPath)?.copy() as! UICollectionViewLayoutAttributes // manipulate the attr return attr }

OptTrader avatar Oct 17 '17 06:10 OptTrader

Were you able to find an answer for this?

FreitDev avatar Aug 05 '18 10:08 FreitDev