Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UICollectionViewFlowLayout has cached frame mismatch for index path #9

Open
OptTrader opened this issue Oct 17, 2017 · 1 comment
Open

Comments

@OptTrader
Copy link

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
Copy link

FreitDev commented Aug 5, 2018

Were you able to find an answer for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants