IGListIndexPathResult
@interface IGListIndexPathResult : NSObject
Result object returned when diffing with sections.
-
Index paths inserted into the new collection.
Declaration
Objective-C
@property (readonly, copy, nonatomic) NSArray<NSIndexPath *> *_Nonnull inserts;
Swift
var inserts: [IndexPath] { get }
-
Index paths deleted from the old collection.
Declaration
Objective-C
@property (readonly, copy, nonatomic) NSArray<NSIndexPath *> *_Nonnull deletes;
Swift
var deletes: [IndexPath] { get }
-
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 }
-
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 }
-
Convenience to query if the result has any changes.
Declaration
Objective-C
- (BOOL)hasChanges;
Swift
func hasChanges() -> Bool
Return Value
YES if the result has changes, NO otherwise.
-
Fetch the index path of the object with identifier before the diff.
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. See -[IGListDiffable diffIdentifier].
Return Value
The index path of the object before the diff, or nil.
-
Fetch the index path of the object with identifier after the diff.
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. See -[IGListDiffable diffIdentifier].
Return Value
The index path of the object after the diff, or nil.
-
Create a new result object transforming index paths that are both moved and updated into delete and inserts.
@discussion This is a convenience method for using a result object to perform UICollectionView and UITableView updates.
Declaration
Objective-C
- (nonnull IGListIndexPathResult *)resultWithUpdatedMovesAsDeleteInserts;
Swift
func withUpdatedMovesAsDeleteInserts() -> IGListIndexPathResult
-
Undocumented
Declaration
Objective-C
@interface IGListIndexPathResult : NSObject
-
Undocumented
Declaration
Objective-C
@interface IGListIndexPathResult : NSObject