mirror of
https://github.com/Instagram/IGListKit
synced 2026-05-09 10:30:52 +00:00
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
35 lines
1.2 KiB
Objective-C
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
|