IGListIndexSetResult
@interface IGListIndexSetResult : NSObject
A result object returned when diffing with indexes.
-
The indexes inserted into the new collection.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSIndexSet *_Nonnull inserts;
Swift
var inserts: IndexSet { get }
-
The indexes deleted from the old collection.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSIndexSet *_Nonnull deletes;
Swift
var deletes: IndexSet { get }
-
The indexes in the old collection that need updated.
Declaration
Objective-C
@property (readonly, strong, nonatomic) NSIndexSet *_Nonnull updates;
Swift
var updates: IndexSet { get }
-
The moves from an index in the old collection to an index in the new collection.
Declaration
Objective-C
@property (readonly, copy, nonatomic) NSArray<IGListMoveIndex *> *_Nonnull moves;
Swift
var moves: [ListMoveIndex] { get }
-
A Read-only boolean that indicates whether the result has any changes or not.
YES
if the result has changes,NO
otherwise.Declaration
Objective-C
@property (readonly, assign, nonatomic) BOOL hasChanges;
Swift
var hasChanges: Bool { get }
-
Returns the index of the object with the specified identifier before the diff.
Declaration
Objective-C
- (NSInteger)oldIndexForIdentifier:(nonnull id<NSObject>)identifier;
Swift
func oldIndex(forIdentifier identifier: NSObjectProtocol) -> Int
Parameters
identifier
The diff identifier of the object.
Return Value
The index of the object before the diff, or
NSNotFound
. -
Returns the index of the object with the specified identifier after the diff.
Declaration
Objective-C
- (NSInteger)newIndexForIdentifier:(nonnull id<NSObject>)identifier;
Swift
func newIndex(forIdentifier identifier: NSObjectProtocol) -> Int
Parameters
identifier
The diff identifier of the object.
Return Value
The index path of the object after the diff, or
NSNotFound
. -
Creates a new result object with operations safe for use in
UITableView
andUICollectionView
batch updates.Declaration
Objective-C
- (nonnull IGListIndexSetResult *)resultForBatchUpdates;
Swift
func forBatchUpdates() -> ListIndexSetResult