-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathGRKArrayDiffInfo.h
More file actions
54 lines (45 loc) · 2.05 KB
/
Copy pathGRKArrayDiffInfo.h
File metadata and controls
54 lines (45 loc) · 2.05 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// GRKArrayDiffInfo.h
//
// Created by Levi Brown on June 23, 2015.
// Copyright (c) 2015 Levi Brown <mailto:[email protected]>
// This work is licensed under the Creative Commons Attribution 3.0
// Unported License. To view a copy of this license, visit
// http://creativecommons.org/licenses/by/3.0/ or send a letter to Creative
// Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041,
// USA.
//
// The above attribution and the included license must accompany any version
// of the source code. Visible attribution in any binary distributable
// including this work (or derivatives) is not required, but would be
// appreciated.
//
#import <Foundation/Foundation.h>
typedef NS_ENUM(NSUInteger, GRKArrayDiffInfoIndexType) {
GRKArrayDiffInfoIndexTypePrevious,
GRKArrayDiffInfoIndexTypeCurrent
};
@interface GRKArrayDiffInfo : NSObject
@property (nonatomic,copy,readonly) NSString *identity;
@property (nonatomic,strong,readonly) NSNumber *previousIndex;
@property (nonatomic,strong,readonly) NSNumber *currentIndex;
- (instancetype)initWithIdentity:(NSString *)identity previousIndex:(NSNumber *)previousIndex currentIndex:(NSNumber *)currentIndex;
/**
* A convenience method for obtaining the property value by enumerated type.
*
* @param type The `GRKArrayDiffInfoIndexType` specifying the desired return value.
*
* @return The `NSNumber` value associated with the given type.
*/
- (NSNumber *)valueForIndexType:(GRKArrayDiffInfoIndexType)type;
/**
* A convenience method for creating an `NSIndexPath` object representing the value of the indicated index, in the specified section.
*
* @param type The `GRKArrayDiffInfoIndexType` specifying the desired index.
* @param section The "section" to use for the index set (in UITableView parlance).
*
* @return An `NSIndexPath` representing the indicated index, in the specified section (in UITableView parlance).
*/
- (NSIndexPath *)indexPathForIndexType:(GRKArrayDiffInfoIndexType)type withSection:(NSInteger)section;
- (BOOL)isEqualToArrayDiffInfo:(GRKArrayDiffInfo *)diffInfo;
@end