mirror of
https://github.com/tappollo/IGListKit.git
synced 2026-04-30 04:45:05 +08:00
Add -[IGListAdapter sectionControllerForSection:]
Summary: Before the diff, you can lookup the object for a given section, and then lookup the section controller for that object, but this seems like a pretty valuable/common operation. Closes https://github.com/Instagram/IGListKit/pull/477 Differential Revision: D4537479 Pulled By: rnystrom fbshipit-source-id: ad47a243f0bb0fc72a362863dff2f00b0b640fab
This commit is contained in:
committed by
Facebook Github Bot
parent
e05cf1e320
commit
106054c181
@@ -783,6 +783,15 @@ XCTAssertEqual(CGPointEqualToPoint(point, p), YES); \
|
||||
XCTAssertEqual([self.adapter sectionForObject:@3], NSNotFound);
|
||||
}
|
||||
|
||||
- (void)test_whenQueryingSectionControllerForSection_thatControllerReturned {
|
||||
self.dataSource.objects = @[@0, @1, @2];
|
||||
[self.adapter reloadDataWithCompletion:nil];
|
||||
|
||||
XCTAssertEqual([self.adapter sectionControllerForSection:0], [self.adapter sectionControllerForObject:@0]);
|
||||
XCTAssertEqual([self.adapter sectionControllerForSection:1], [self.adapter sectionControllerForObject:@1]);
|
||||
XCTAssertEqual([self.adapter sectionControllerForSection:2], [self.adapter sectionControllerForObject:@2]);
|
||||
}
|
||||
|
||||
- (void)test_whenReloadingData_withNoDataSource_thatCompletionCalledWithNO {
|
||||
self.dataSource.objects = @[@1];
|
||||
IGListAdapter *adapter = [[IGListAdapter alloc] initWithUpdater:[IGListReloadDataUpdater new]
|
||||
|
||||
Reference in New Issue
Block a user