ApplikeySolutions / VegaScroll

↕️ VegaScroll is a lightweight animation flowlayout for UICollectionView completely written in Swift 4, compatible with iOS 11 and Xcode 9.
https://applikeysolutions.com
MIT License
2.94k stars 178 forks source link

UICollectionViewFlowLayout has cached frame mismatch for index path #9

Open OptTrader opened 7 years ago

OptTrader commented 7 years ago

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 }

FreitDev commented 6 years ago

Were you able to find an answer for this?