mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-15 05:18:18 +00:00
Summary: Lets test that the new updater (`IGListExperimentalAdapterUpdater`) can handle a missing section-controller. The old adapater `IGListAdapterUpdater` would crash. Reviewed By: patters Differential Revision: D23145773 fbshipit-source-id: 4589dcb11ddef5c7400947aea4b6827f1b2caaa8
36 lines
1 KiB
Objective-C
36 lines
1 KiB
Objective-C
/*
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#import "IGTestDelegateDataSource.h"
|
|
|
|
#import <IGListKit/IGListAdapter.h>
|
|
|
|
#import "IGTestDelegateController.h"
|
|
#import "IGTestObject.h"
|
|
|
|
NSObject *const kIGTestDelegateDataSourceSkipObject = @"kIGTestDelegateDataSourceSkipObject";
|
|
|
|
@implementation IGTestDelegateDataSource
|
|
|
|
- (NSArray *)objectsForListAdapter:(IGListAdapter *)listAdapter {
|
|
return self.objects;
|
|
}
|
|
|
|
- (IGListSectionController *)listAdapter:(IGListAdapter *)listAdapter sectionControllerForObject:(id)object {
|
|
if ([object isEqual:kIGTestDelegateDataSourceSkipObject]) {
|
|
return nil;
|
|
}
|
|
IGTestDelegateController *sectionController = [[IGTestDelegateController alloc] init];
|
|
sectionController.cellConfigureBlock = self.cellConfigureBlock;
|
|
return sectionController;
|
|
}
|
|
|
|
- (nullable UIView *)emptyViewForListAdapter:(IGListAdapter *)listAdapter {
|
|
return nil;
|
|
}
|
|
|
|
@end
|