2016-09-07 22:37:59 +00:00
|
|
|
/**
|
|
|
|
|
* Copyright (c) 2016-present, Facebook, Inc.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* This source code is licensed under the BSD-style license found in the
|
|
|
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#import "IGListTestAdapterDataSource.h"
|
|
|
|
|
|
|
|
|
|
#import <IGListKit/IGListAdapter.h>
|
|
|
|
|
|
|
|
|
|
#import "IGListTestSection.h"
|
2017-03-15 16:25:03 +00:00
|
|
|
#import "IGListTestContainerSizeSection.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
|