Skip to content

Commit

Permalink
Rename "withCollectionView:" param to "collectionView:"
Browse files Browse the repository at this point in the history
Summary:
- Rename "withCollectionView:" param to "collectionView:" param to be consistent with the rest
of the protocol.
- Update tests.

Related issue: #466

- [x] All tests pass. Demo project builds and runs.
- [ ] 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 #491

Differential Revision: D4589976

Pulled By: rnystrom

fbshipit-source-id: 5e5aa7328a6bbac6baa705d5228f0eb4321d8c31
  • Loading branch information
Vincent Peng authored and facebook-github-bot committed Feb 21, 2017
1 parent 8cf2bbe commit 2adea72
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ This release closes the [3.0.0 milestone](https://github.com/Instagram/IGListKit

- Replaced `IGListGridCollectionViewLayout` with `IGListCollectionViewLayout`. [[Ryan Nystrom](https://github.com/rnystrom) [(tbd)](https://github.com/Instagram/IGListKit/pull/tbd)

- Renamed `IGListAdapterUpdaterDelegate` method to `listAdapterUpdater:didPerformBatchUpdates:collectionView:`. [Vincent Peng](https://github.com/vincent-peng) [(#491)](https://github.com/Instagram/IGListKit/pull/491)


### Enhancements

- You can now manually move items (cells) within a section controller, ex: `[self.collectionContext moveInSectionController:self fromIndex:0 toIndex:1]`. [Ryan Nystrom](https://github.com/rnystrom) [(#418)](https://github.com/Instagram/IGListKit/pull/418)
Expand Down Expand Up @@ -209,3 +212,5 @@ You can find a [migration guide here](https://instagram.github.io/IGListKit/migr
-----

Initial release. :tada:


2 changes: 1 addition & 1 deletion Source/IGListAdapterUpdater.m
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ - (void)performBatchUpdatesWithCollectionView:(UICollectionView *)collectionView

executeCompletionBlocks(finished);

[delegate listAdapterUpdater:self didPerformBatchUpdates:updateData withCollectionView:collectionView];
[delegate listAdapterUpdater:self didPerformBatchUpdates:updateData collectionView:collectionView];

// queue another update in case something changed during batch updates. this method will bail next runloop if
// there are no changes
Expand Down
2 changes: 1 addition & 1 deletion Source/IGListAdapterUpdaterDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)listAdapterUpdater:(IGListAdapterUpdater *)listAdapterUpdater
didPerformBatchUpdates:(IGListBatchUpdateData *)updates
withCollectionView:(UICollectionView *)collectionView;
collectionView:(UICollectionView *)collectionView;

/**
Notifies the delegate that the updater will call `-[UICollectionView insertItemsAtIndexPaths:]`.
Expand Down
6 changes: 3 additions & 3 deletions Tests/IGListAdapterUpdaterTests.m
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ - (void)test_whenPerformingUpdates_withNilCollectionView_thatDelegateEventNotSen
self.updater.delegate = mockDelegate;
id compilerFriendlyNil = nil;
[[mockDelegate reject] listAdapterUpdater:self.updater willPerformBatchUpdatesWithCollectionView:compilerFriendlyNil];
[[mockDelegate reject] listAdapterUpdater:self.updater didPerformBatchUpdates:[OCMArg any] withCollectionView:compilerFriendlyNil];
[[mockDelegate reject] listAdapterUpdater:self.updater didPerformBatchUpdates:[OCMArg any] collectionView:compilerFriendlyNil];
[self.updater performBatchUpdatesWithCollectionView:compilerFriendlyNil];
[mockDelegate verify];
}
Expand Down Expand Up @@ -467,7 +467,7 @@ - (void)test_whenCollectionViewNotInWindow_andBackgroundReloadFlag_isSetNO_diffH
self.updater.delegate = mockDelegate;
[mockDelegate setExpectationOrderMatters:YES];
[[mockDelegate expect] listAdapterUpdater:self.updater willPerformBatchUpdatesWithCollectionView:self.collectionView];
[[mockDelegate expect] listAdapterUpdater:self.updater didPerformBatchUpdates:OCMOCK_ANY withCollectionView:self.collectionView];
[[mockDelegate expect] listAdapterUpdater:self.updater didPerformBatchUpdates:OCMOCK_ANY collectionView:self.collectionView];

XCTestExpectation *expectation = genExpectation;
NSArray *to = @[
Expand All @@ -492,7 +492,7 @@ - (void)test_whenCollectionViewNotInWindow_andBackgroundReloadFlag_isDefaultYES_
// except the batch updates calls.

[[mockDelegate reject] listAdapterUpdater:self.updater willPerformBatchUpdatesWithCollectionView:self.collectionView];
[[mockDelegate reject] listAdapterUpdater:self.updater didPerformBatchUpdates:OCMOCK_ANY withCollectionView:self.collectionView];
[[mockDelegate reject] listAdapterUpdater:self.updater didPerformBatchUpdates:OCMOCK_ANY collectionView:self.collectionView];

XCTestExpectation *expectation = genExpectation;
NSArray *to = @[
Expand Down

0 comments on commit 2adea72

Please sign in to comment.