IGListBindingSectionControllerDataSource
Objective-C
@protocol IGListBindingSectionControllerDataSource <NSObject>
                Swift
protocol ListBindingSectionControllerDataSource : NSObjectProtocol
                A protocol that returns data to power cells in an IGListBindingSectionController.
- 
                  
                  
Create an array of view models given a top-level object.
Declaration
Objective-C
- (nonnull NSArray<id<IGListDiffable>> *) sectionController: (nonnull IGListBindingSectionController *)sectionController viewModelsForObject:(nonnull id)object;Swift
func sectionController(_ sectionController: IGListBindingSectionController, viewModelsFor object: Any) -> [any IGListDiffable]Parameters
sectionControllerThe section controller requesting view models.
objectThe top-level object that powers the section controller.
Return Value
A new array of view models.
 - 
                  
                  
Return a dequeued cell for a given view model.
Note
The section controller will call
-bindViewModel:with the provided view model after the cell is dequeued. You should handle cell configuration using this method. However, you can do additional configuration at this stage as well.Declaration
Objective-C
- (nonnull UICollectionViewCell<IGListBindable> *) sectionController: (nonnull IGListBindingSectionController *)sectionController cellForViewModel:(nonnull id)viewModel atIndex:(NSInteger)index;Swift
func sectionController(_ sectionController: IGListBindingSectionController, cellForViewModel viewModel: Any, at index: Int) -> any UICollectionViewCell & IGListBindableParameters
sectionControllerThe section controller requesting a cell.
viewModelThe view model for the cell.
indexThe index of the view model.
Return Value
A dequeued cell.
 - 
                  
                  
Return a cell size for a given view model.
Declaration
Objective-C
- (CGSize)sectionController: (nonnull IGListBindingSectionController *)sectionController sizeForViewModel:(nonnull id)viewModel atIndex:(NSInteger)index;Swift
func sectionController(_ sectionController: IGListBindingSectionController, sizeForViewModel viewModel: Any, at index: Int) -> CGSizeParameters
sectionControllerThe section controller requesting a size.
viewModelThe view model for the cell.
indexThe index of the view model.
Return Value
A size for the view model.
 
View on GitHub