2019-12-19 17:32:49 +00:00
|
|
|
/*
|
2023-04-06 09:44:16 +00:00
|
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
2016-09-07 22:37:59 +00:00
|
|
|
*
|
2019-12-19 17:32:49 +00:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2016-09-07 22:37:59 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#import "IGListTestAdapterDataSource.h"
|
|
|
|
|
|
|
|
|
|
#import <IGListKit/IGListAdapter.h>
|
|
|
|
|
|
2017-03-15 16:25:03 +00:00
|
|
|
#import "IGListTestContainerSizeSection.h"
|
2019-12-19 17:32:49 +00:00
|
|
|
#import "IGListTestSection.h"
|
2016-09-07 22:37:59 +00:00
|
|
|
|
|
|
|
|
@implementation IGListTestAdapterDataSource
|
|
|
|
|
|
|
|
|
|
- (NSArray *)objectsForListAdapter:(IGListAdapter *)listAdapter {
|
|
|
|
|
return self.objects;
|
|
|
|
|
}
|
|
|
|
|
|
2017-04-19 15:17:56 +00:00
|
|
|
- (IGListSectionController *)listAdapter:(IGListAdapter *)listAdapter sectionControllerForObject:(id)object {
|
2017-02-14 16:01:16 +00:00
|
|
|
if ([object isKindOfClass:[NSNumber class]]) {
|
2017-03-15 16:25:03 +00:00
|
|
|
if ([(NSNumber*)object isEqual: @42]) {
|
|
|
|
|
return [IGListTestContainerSizeSection new];
|
|
|
|
|
}
|
2017-02-14 16:01:16 +00:00
|
|
|
return [IGListTestSection new];
|
|
|
|
|
}
|
|
|
|
|
return nil;
|
2016-09-07 22:37:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (nullable UIView *)emptyViewForListAdapter:(IGListAdapter *)listAdapter {
|
2017-02-12 22:23:30 +00:00
|
|
|
return self.backgroundView;
|
2016-09-07 22:37:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@end
|