IGListIndexPathResult
@interface IGListIndexPathResult : NSObject
A result object returned when diffing with sections.
-
The index paths inserted into the new collection.
Declaration
Objective-C
@property (readonly, copy, nonatomic) NSArray<NSIndexPath *> *_Nonnull inserts;
Swift
var inserts: [IndexPath] { get }
-
The index paths deleted from the old collection.
Declaration
Objective-C
@property (readonly, copy, nonatomic) NSArray<NSIndexPath *> *_Nonnull deletes;
Swift
var deletes: [IndexPath] { get }
-
The index paths in the new collection that need updated.
Declaration
Objective-C
@property (readonly, copy, nonatomic) NSArray<NSIndexPath *> *_Nonnull updates;
Swift
var updates: [IndexPath] { get }
-
The moves from an index path in the old collection to an index path in the new collection.
Declaration
Objective-C
@property (readonly, copy, nonatomic) NSArray<IGListMoveIndexPath *> *_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 path of the object with the specified identifier before the diff.
See
-[IGListDiffable diffIdentifier]
.Declaration
Objective-C
- (nullable NSIndexPath *)oldIndexPathForIdentifier: (nonnull id<NSObject>)identifier;
Swift
func oldIndexPath(forIdentifier identifier: NSObjectProtocol) -> IndexPath?
Parameters
identifier
The diff identifier of the object.
Return Value
The index path of the object before the diff, or
nil
. -
Returns the index path of the object with the specified identifier after the diff.
See
-[IGListDiffable diffIdentifier]
.Declaration
Objective-C
- (nullable NSIndexPath *)newIndexPathForIdentifier: (nonnull id<NSObject>)identifier;
Swift
func newIndexPath(forIdentifier identifier: NSObjectProtocol) -> IndexPath?
Parameters
identifier
The diff identifier of the object.
Return Value
The index path of the object after the diff, or
nil
. -
Creates a new result object with operations safe for use in
UITableView
andUICollectionView
batch updates.Declaration
Objective-C
- (nonnull IGListIndexPathResult *)resultForBatchUpdates;
Swift
func forBatchUpdates() -> IGListIndexPathResult