IGListKit/Tests/Objects/IGListTestUICollectionViewDataSource.h
Zhisheng Huang d7a6fc0847 Add a flag to control how the IGSectionObject's isEqualToDiffable: is implemented
Summary:
In the Feed view, all the -isEqualToDiffable: implementation only checks the pk, a.k.a the identifier.

Let's mimic that behavior.

Reviewed By: calimarkus

Differential Revision: D18714064

fbshipit-source-id: e1fe9624da2997ecc7ca9b684ddd471d77b7564c
2019-12-04 15:32:04 -08:00

35 lines
1.2 KiB
Objective-C

/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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 <UIKit/UIKit.h>
#import <IGListDiffKit/IGListDiffable.h>
@interface IGSectionObject : NSObject <IGListDiffable>
@property (nonatomic, strong) NSArray *objects;
+ (instancetype)sectionWithObjects:(NSArray *)objects;
+ (instancetype)sectionWithObjects:(NSArray *)objects identifier:(NSString *)identifier;
/**
@param usesIdentifierForDiffable YES if we only use the `identifier` for -isEqualToDiffableObject. NO then we compares both the `identifier` as well as `objects`.
*/
+ (instancetype)sectionWithObjects:(NSArray *)objects identifier:(NSString *)identifier usesIdentifierForDiffable:(BOOL)usesIdentifierForDiffable;
@end
@interface IGListTestUICollectionViewDataSource : NSObject <UICollectionViewDataSource>
@property (nonatomic, strong) NSArray <IGSectionObject *> *sections;
- (instancetype)initWithCollectionView:(UICollectionView *)collectionView;
@end