IGListBatchContext
Objective-C
@protocol IGListBatchContext <NSObject>
Swift
protocol ListBatchContext : NSObjectProtocol
Objects conforming to the IGListBatchContext protocol provide a way for section controllers to mutate their cells or reload everything within the section.
-
Reloads cells in the section controller.
Declaration
Objective-C
- (void)reloadInSectionController: (nonnull IGListSectionController *)sectionController atIndexes:(nonnull NSIndexSet *)indexes;Swift
func reload(in sectionController: IGListSectionController, at indexes: IndexSet)Parameters
sectionControllerThe section controller who’s cells need reloading.
indexesThe indexes of items that need reloading.
-
Inserts cells in the list.
Declaration
Objective-C
- (void)insertInSectionController: (nonnull IGListSectionController *)sectionController atIndexes:(nonnull NSIndexSet *)indexes;Swift
func insert(in sectionController: IGListSectionController, at indexes: IndexSet)Parameters
sectionControllerThe section controller who’s cells need inserting.
indexesThe indexes of items that need inserting.
-
Deletes cells in the list.
Declaration
Objective-C
- (void)deleteInSectionController: (nonnull IGListSectionController *)sectionController atIndexes:(nonnull NSIndexSet *)indexes;Swift
func delete(in sectionController: IGListSectionController, at indexes: IndexSet)Parameters
sectionControllerThe section controller who’s cells need deleted.
indexesThe indexes of items that need deleting.
-
Invalidates layouts of cells at specific in the section controller.
Declaration
Objective-C
- (void)invalidateLayoutInSectionController: (nonnull IGListSectionController *)sectionController atIndexes:(nonnull NSIndexSet *)indexes;Swift
func invalidateLayout(in sectionController: IGListSectionController, at indexes: IndexSet)Parameters
sectionControllerThe section controller who’s cells need invalidating.
indexesThe indexes of items that need invalidating.
-
Moves a cell from one index to another within the section controller.
Declaration
Objective-C
- (void)moveInSectionController: (nonnull IGListSectionController *)sectionController fromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex;Swift
func move(in sectionController: IGListSectionController, from fromIndex: Int, to toIndex: Int)Parameters
sectionControllerThe section controller who’s cell needs moved.
fromIndexThe index the cell is currently in.
toIndexThe index the cell should move to.
-
Reloads the entire section controller.
Declaration
Objective-C
- (void)reloadSectionController: (nonnull IGListSectionController *)sectionController;Swift
func reload(_ sectionController: IGListSectionController)Parameters
sectionControllerThe section controller who’s cells need reloading.
-
Moves a section controller from one index to another during interactive reordering.
Declaration
Objective-C
- (void)moveSectionControllerInteractive: (nonnull IGListSectionController *)sectionController fromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex;Swift
func moveSectionControllerInteractive(_ sectionController: IGListSectionController, from fromIndex: Int, to toIndex: Int)Parameters
sectionControllerThe section controller to move.
fromIndexThe index where the section currently resides.
toIndexThe index the section should move to.
-
Moves an object within a section controller from one index to another during interactive reordering.
Declaration
Objective-C
- (void)moveInSectionControllerInteractive: (nonnull IGListSectionController *)sectionController fromIndex:(NSInteger)fromIndex toIndex:(NSInteger)toIndex;Swift
func move(inSectionControllerInteractive sectionController: IGListSectionController, from fromIndex: Int, to toIndex: Int)Parameters
sectionControllerThe section controller containing the object to move.
fromIndexThe index where the object currently resides.
toIndexThe index the object should move to.
-
Reverts an move from one indexPath to another during interactive reordering.
Declaration
Objective-C
- (void)revertInvalidInteractiveMoveFromIndexPath: (nonnull NSIndexPath *)sourceIndexPath toIndexPath:(nonnull NSIndexPath *) destinationIndexPath;Swift
func revertInvalidInteractiveMove(from sourceIndexPath: IndexPath, to destinationIndexPath: IndexPath)Parameters
sourceIndexPathThe indexPath the item was originally in.
destinationIndexPathThe indexPath the item was moving to.
View on GitHub