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

Recursive loop when implementing cell's preferredLayoutAttributesFittingAttributes: #17

Open
markst opened this issue Aug 29, 2016 · 2 comments

Comments

@markst
Copy link

markst commented Aug 29, 2016

Possibly related to #11

If using estimated item sizes:

layout.estimatedItemSize = CGSizeMake(50, 50);

in combination with UICollectionViewCell override of:

- (UICollectionViewLayoutAttributes *)preferredLayoutAttributesFittingAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    CGFloat randomWidth = (arc4random() % 120) + 60;
    layoutAttributes.size = CGSizeMake(randomWidth, 60);
    return layoutAttributes;
}

Application will fall into recursive loop.

@lukecharman
Copy link

@pmusolino
Copy link

Same here

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

3 participants