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

Mitmatched frame #5

Open
PatrickSH79 opened this issue Feb 28, 2019 · 1 comment
Open

Mitmatched frame #5

PatrickSH79 opened this issue Feb 28, 2019 · 1 comment

Comments

@PatrickSH79
Copy link

`Hi ApplikeySolutions,
Unfortunately, I ran into a Problem with GravitySlider using Swift 4.1 on XCode 10.1:

TIMESTAMP MYAPP[4843:192324] Logging only once for UICollectionViewFlowLayout cache mismatched frame
TIMESTAMP MYAPP[4843:192324] UICollectionViewFlowLayout has cached frame mismatch for index path <NSIndexPath: 0xc3c3a5e22250291b> {length = 2, path = 0 - 1} - cached value: {{154.45696076278136, 67.006175491898148}, {152.38257137345681, 206.54764901620371}}; expected value: {{177.5, 51}, {176, 238.56}}
TIMESTAMP MYAPP[4843:192324] This is likely occurring because the flow layout subclass GravitySliderFlowLayout.GravitySliderFlowLayout is modifying attributes returned by UICollectionViewFlowLayout without copying them

I already tried things like copying the Attributes as shown on StackOverflow (https://stackoverflow.com/questions/31508153/warning-uicollectionviewflowlayout-has-cached-frame-mismatch-for-index-path-ab), but it didn't work out.

Any ideas / help on that?

Thank you in advance!
-Patrick

@andreimarkoff
Copy link

guard let collectionView = collectionView, let attri = super.layoutAttributesForElements(in: targetRect) else { return nil }
guard let attributes = NSArray(array: attri, copyItems: true) as? [UICollectionViewLayoutAttributes] else { return nil }

@PatrickSH79 this worked for me

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