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 new 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: [Any] { get }
-
Returns whether the result has any changes or not.
Declaration
Objective-C
- (BOOL)hasChanges;
Swift
func hasChanges() -> Bool
Return Value
YES
if the result has changes,NO
otherwise. -
Returns the index of the object with the specified identifier before the diff.
See
-[IGListDiffable diffIdentifier]
.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.
See
-[IGListDiffable diffIdentifier]
.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() -> IGListIndexSetResult