Skip to content

Commit

Permalink
Updated IGListCollectionViewLayout to rely on layoutAttributesClass
Browse files Browse the repository at this point in the history
Summary:
…instead of just allocating a vanilla UICollectionViewLayoutAttributes.    I'm happy to add tests here, but don't really have much of an opinion either way on whether this should have an explicit test case or not.

Issue fixed: #1134

- [x] All tests pass. Demo project builds and runs.
- [x] I added tests, an experiment, or detailed why my change isn't tested.
- [x] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes.
- [x] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md)
Closes #1135

Differential Revision: D7551624

Pulled By: rnystrom

fbshipit-source-id: 930218c40b0082912454bb98bd02e7daa8257a3e
  • Loading branch information
SirensOfTitan authored and facebook-github-bot committed Apr 9, 2018
1 parent 5c7a031 commit 9a45e16
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ The changelog for `IGListKit`. Also see the [releases](https://github.com/instag

- Fixed footer is sticky when `stickyHeader` is `true` [aelam](https://github.com/aelam) [(#1094)](https://github.com/Instagram/IGListKit/pull/1094)

- Updated IGListCollectionViewLayout to rely on layoutAttributesClass instead of vanilla `UICollectionViewLayoutAttributes` [Cole Potrocky](https://github.com/SirensOfTitan) [#1135](https://github.com/instagram/IGListKit/pull/1135)

- `-[IGListSectionController didSelectItemAtIndex:]` is now called when a `scrollViewDelegate` or `collectionViewDelegate` is set. [Ryan Nystrom](https://github.com/rnystrom) [(#1108)](https://github.com/Instagram/IGListKit/pull/1108)

3.2.0
Expand Down
2 changes: 1 addition & 1 deletion Source/IGListCollectionViewLayout.mm
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSInde
return nil;
}

attributes = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath];
attributes = [[[self class] layoutAttributesClass] layoutAttributesForCellWithIndexPath:indexPath];
attributes.frame = _sectionData[indexPath.section].itemBounds[indexPath.item];
adjustZIndexForAttributes(attributes);
_attributesCache[indexPath] = attributes;
Expand Down

0 comments on commit 9a45e16

Please sign in to comment.