-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathVMBArrayDiff.h
More file actions
27 lines (15 loc) · 844 Bytes
/
VMBArrayDiff.h
File metadata and controls
27 lines (15 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef BOOL (^VMBArrayElementComparator)(id left, id right);
typedef NS_ENUM(NSInteger, VMBArrayDiffChangeType) {
VMBArrayDiffChangeTypeInsert,
VMBArrayDiffChangeTypeDelete
};
@interface VMBArrayDiffChange : NSObject <NSCopying>
- (instancetype)initWithChangeKind:(VMBArrayDiffChangeType)changeKind index:(NSUInteger)index;
@property (nonatomic, readonly) VMBArrayDiffChangeType changeType;
@property (nonatomic, readonly) NSUInteger index;
@end
extern NSSet<VMBArrayDiffChange *> *VMBChangesByDiffingArrays(NSArray *left, NSArray *right) __attribute__((overloadable));
extern NSSet<VMBArrayDiffChange *> *VMBChangesByDiffingArrays(NSArray *left, NSArray *right, __nullable VMBArrayElementComparator comparator) __attribute__((overloadable));
NS_ASSUME_NONNULL_END