RBLazyLayoutViewDataSource Protocol Reference

Conforms to NSObject
Declared in RBLazyLayoutView.h

Overview

The data source that provides cells to a RBLazyLayoutView.

– countForLayoutView: required method

Gets the number of cells to be displayed in the layout view.

- (NSInteger)countForLayoutView:(nonnull RBLazyLayoutView *)layoutView

Parameters

layoutView

The layout view object.

Return Value

The number of cells.

Declared In

RBLazyLayoutView.h

– cellSizeAtIndex:withContainer:forLayoutView: required method

Gets the desired size of the cell at the given index, with the available container size provided.

- (CGSize)cellSizeAtIndex:(NSInteger)index withContainer:(CGSize)container forLayoutView:(nonnull RBLazyLayoutView *)layoutView

Parameters

index

The index of the cell to size.

container

The available size for the cell in it’s container.

layoutView

The layout view object.

Return Value

The desired size of the cell.

Declared In

RBLazyLayoutView.h

– cellAtIndex:forLayoutView: required method

Gets the cell to be presented in the layout view at the given index. The reusableCellWithType:configurationOnCreation: or reusableCellWithType:shouldApplyTheming:configurationOnCreation methods should be used. The first is a convienance method that passes YES as the the shouldApplyTheming parameter to the second.

- (nonnull __kindof RBBaseCellView *)cellAtIndex:(NSInteger)index forLayoutView:(nonnull RBLazyLayoutView *)layoutView

Parameters

index

The index of the cell.

layoutView

The layout view object.

Return Value

The prepared cell.

Declared In

RBLazyLayoutView.h

– layoutView:willRemoveCell:atIndex:

Called when a cell will be removed from the layout view and stored for reuse at a later stage. Use this to stop any image download jobs, etc.

- (void)layoutView:(nonnull RBLazyLayoutView *)layoutView willRemoveCell:(nonnull __kindof RBBaseCellView *)cell atIndex:(NSInteger)index

Parameters

layoutView

The layout view object.

cell

The cell that is being removed.

index

The index of the cell.

Declared In

RBLazyLayoutView.h