Skip to content

Commit

Permalink
Update changelog, fix will-drag
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Nystrom committed Dec 5, 2016
1 parent 9feb2f0 commit 6cccb90
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ This release closes the [2.0.0 milestone](https://github.com/Instagram/IGListKit

- Added `tvOS` example pack. [Sherlouk](https://github.com/Sherlouk) [(#141)](https://github.com/Instagram/IGListKit/pull/141)

- Fixed a bug where `IGListStackSectionController` would only set its supplementary source once. [Ryan Nystrom](https://github.com/rnystrom) [(#286)](https://github.com/Instagram/IGListKit/pull/286)

- Fixed a bug where `IGListStackSectionController` passed the wrong section controller for will-drag scroll events. [Ryan Nystrom](https://github.com/rnystrom) [(#286)](https://github.com/Instagram/IGListKit/pull/286)

1.0.0
-----

Expand Down
2 changes: 1 addition & 1 deletion Source/IGListStackedSectionController.m
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ - (void)listAdapter:(IGListAdapter *)listAdapter didScrollSectionController:(IGL

- (void)listAdapter:(IGListAdapter *)listAdapter willBeginDraggingSectionController:(IGListSectionController<IGListSectionType> *)sectionController {
for (IGListSectionController<IGListSectionType> *childSectionController in self.sectionControllers) {
[[childSectionController scrollDelegate] listAdapter:listAdapter willBeginDraggingSectionController:sectionController];
[[childSectionController scrollDelegate] listAdapter:listAdapter willBeginDraggingSectionController:childSectionController];
}
}

Expand Down
46 changes: 32 additions & 14 deletions Tests/IGListStackSectionControllerTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -496,11 +496,17 @@ - (void)test_whenForwardingDidScrollEvent_thatChildSectionControllersReceiveEven
IGListStackedSectionController *stack0 = [self.adapter sectionControllerForObject:self.dataSource.objects[0]];
IGListStackedSectionController *stack1 = [self.adapter sectionControllerForObject:self.dataSource.objects[1]];

stack0.scrollDelegate = mockScrollDelegate;
stack1.scrollDelegate = mockScrollDelegate;

[[mockScrollDelegate expect] listAdapter:self.adapter didScrollSectionController:stack0];
[[mockScrollDelegate expect] listAdapter:self.adapter didScrollSectionController:stack1];
[stack0.sectionControllers[0] setScrollDelegate:mockScrollDelegate];
[stack0.sectionControllers[1] setScrollDelegate:mockScrollDelegate];
[stack0.sectionControllers[2] setScrollDelegate:mockScrollDelegate];
[stack1.sectionControllers[0] setScrollDelegate:mockScrollDelegate];
[stack1.sectionControllers[1] setScrollDelegate:mockScrollDelegate];

[[mockScrollDelegate expect] listAdapter:self.adapter didScrollSectionController:stack0.sectionControllers[0]];
[[mockScrollDelegate expect] listAdapter:self.adapter didScrollSectionController:stack0.sectionControllers[1]];
[[mockScrollDelegate expect] listAdapter:self.adapter didScrollSectionController:stack0.sectionControllers[2]];
[[mockScrollDelegate expect] listAdapter:self.adapter didScrollSectionController:stack1.sectionControllers[0]];
[[mockScrollDelegate expect] listAdapter:self.adapter didScrollSectionController:stack1.sectionControllers[1]];

[self.adapter scrollViewDidScroll:self.collectionView];

Expand All @@ -518,11 +524,17 @@ - (void)test_whenForwardingWillBeginDraggingEvent_thatChildSectionControllersRec
IGListStackedSectionController *stack0 = [self.adapter sectionControllerForObject:self.dataSource.objects[0]];
IGListStackedSectionController *stack1 = [self.adapter sectionControllerForObject:self.dataSource.objects[1]];

stack0.scrollDelegate = mockScrollDelegate;
stack1.scrollDelegate = mockScrollDelegate;
[stack0.sectionControllers[0] setScrollDelegate:mockScrollDelegate];
[stack0.sectionControllers[1] setScrollDelegate:mockScrollDelegate];
[stack0.sectionControllers[2] setScrollDelegate:mockScrollDelegate];
[stack1.sectionControllers[0] setScrollDelegate:mockScrollDelegate];
[stack1.sectionControllers[1] setScrollDelegate:mockScrollDelegate];

[[mockScrollDelegate expect] listAdapter:self.adapter willBeginDraggingSectionController:stack0];
[[mockScrollDelegate expect] listAdapter:self.adapter willBeginDraggingSectionController:stack1];
[[mockScrollDelegate expect] listAdapter:self.adapter willBeginDraggingSectionController:stack0.sectionControllers[0]];
[[mockScrollDelegate expect] listAdapter:self.adapter willBeginDraggingSectionController:stack0.sectionControllers[1]];
[[mockScrollDelegate expect] listAdapter:self.adapter willBeginDraggingSectionController:stack0.sectionControllers[2]];
[[mockScrollDelegate expect] listAdapter:self.adapter willBeginDraggingSectionController:stack1.sectionControllers[0]];
[[mockScrollDelegate expect] listAdapter:self.adapter willBeginDraggingSectionController:stack1.sectionControllers[1]];

[self.adapter scrollViewWillBeginDragging:self.collectionView];

Expand All @@ -540,11 +552,17 @@ - (void)test_whenForwardingDidEndDraggingEvent_thatChildSectionControllersReceiv
IGListStackedSectionController *stack0 = [self.adapter sectionControllerForObject:self.dataSource.objects[0]];
IGListStackedSectionController *stack1 = [self.adapter sectionControllerForObject:self.dataSource.objects[1]];

stack0.scrollDelegate = mockScrollDelegate;
stack1.scrollDelegate = mockScrollDelegate;

[[mockScrollDelegate expect] listAdapter:self.adapter didEndDraggingSectionController:stack0 willDecelerate:NO];
[[mockScrollDelegate expect] listAdapter:self.adapter didEndDraggingSectionController:stack1 willDecelerate:NO];
[stack0.sectionControllers[0] setScrollDelegate:mockScrollDelegate];
[stack0.sectionControllers[1] setScrollDelegate:mockScrollDelegate];
[stack0.sectionControllers[2] setScrollDelegate:mockScrollDelegate];
[stack1.sectionControllers[0] setScrollDelegate:mockScrollDelegate];
[stack1.sectionControllers[1] setScrollDelegate:mockScrollDelegate];

[[mockScrollDelegate expect] listAdapter:self.adapter didEndDraggingSectionController:stack0.sectionControllers[0] willDecelerate:NO];
[[mockScrollDelegate expect] listAdapter:self.adapter didEndDraggingSectionController:stack0.sectionControllers[1] willDecelerate:NO];
[[mockScrollDelegate expect] listAdapter:self.adapter didEndDraggingSectionController:stack0.sectionControllers[2] willDecelerate:NO];
[[mockScrollDelegate expect] listAdapter:self.adapter didEndDraggingSectionController:stack1.sectionControllers[0] willDecelerate:NO];
[[mockScrollDelegate expect] listAdapter:self.adapter didEndDraggingSectionController:stack1.sectionControllers[1] willDecelerate:NO];

[self.adapter scrollViewDidEndDragging:self.collectionView willDecelerate:NO];

Expand Down

0 comments on commit 6cccb90

Please sign in to comment.