IGListBatchContext

@protocol IGListBatchContext <NSObject>

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

    sectionController

    The section controller who’s cells need reloading.

    indexes

    The 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

    sectionController

    The section controller who’s cells need inserting.

    indexes

    The 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

    sectionController

    The section controller who’s cells need deleted.

    indexes

    The indexes of items that need deleting.

  • 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

    sectionController

    The section controller who’s cell needs moved.

    fromIndex

    The index the cell is currently in.

    toIndex

    The 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

    sectionController

    The section controller who’s cells need reloading.