Skip to content
This repository was archived by the owner on Oct 31, 2019. It is now read-only.

Conversation

@chenkun24
Copy link

No description provided.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if([layoutAttributes.representedElementKind isEqualToString:UICollectionElementKindSectionHeader] || [layoutAttributes.representedElementKind isEqualToString:UICollectionElementKindSectionFooter]) {
continue;
}

Add this check at line 126 (right before you addObject to indexPathArray). The issue is that the header and footer shouldn't have their indexPaths altered as they are always set to a specific indexPath because they are always at the top or bottom of a section.

@lukescott
Copy link
Owner

Anyone here interested in maintaining this? I just need someone to accept PR's that fix issues without changing too much. At the moment I don't have time to do so.

In the future when things calm down I plan to write a new flow layout with drag & drop. It's a different approach than the current lib, and will likely be in a different repo.

@chenkun24
Copy link
Author

Thanks @wsidell for finding out the problem, and I added codes mentioned by @cms5822.

I find out that header or footer elements are always at the tail of the elements array. So another way to change the supplementary problem is to rewrite the comparator and put supplementary elements at the tail of the elements array, but that would make a big change to the comparator. So I just solve it simply.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants