RBLazyLayoutView Class Reference

Inherits from RBBaseLayoutView : RBScrollView : UIScrollView
Conforms to UIGestureRecognizerDelegate
Declared in RBLazyLayoutView.h

Overview

The lazy loading layout view.

  delegate

A delegate that receives cell loading, appearance and positioning events.

@property (nonatomic, weak, nullable) id<RBLazyLayoutViewDelegate,RBBaseLayoutViewDelegate> delegate

Declared In

RBLazyLayoutView.h

  dataSource

The data source that provides cells to the layout view.

@property (nonatomic, weak, nullable) id<RBLazyLayoutViewDataSource> dataSource

Declared In

RBLazyLayoutView.h

  allowsSelection

Whether or not the cell allows selection. Default = YES.

@property (nonatomic) BOOL allowsSelection

Declared In

RBLazyLayoutView.h

  allowsMultipleSelection

Whether or not the cell allows selection. Default = NO.

@property (nonatomic) BOOL allowsMultipleSelection

Declared In

RBLazyLayoutView.h

  zeroSelectionAllowed

Whether or not the last selected item can be unselected. Default = YES.

@property (nonatomic) BOOL zeroSelectionAllowed

Declared In

RBLazyLayoutView.h

  selectedCellCount

The count of the currently selected cells.

@property (nonatomic, readonly) NSInteger selectedCellCount

Declared In

RBLazyLayoutView.h

  selectedCellIndexes

The indexes of the currently selected cells.

@property (nonatomic, readonly, nonnull) NSArray<NSNumber*> *selectedCellIndexes

Declared In

RBLazyLayoutView.h

  updatesPaused

Indicates whether or not laying out cells, reloadData, reloadCellAt and changes to viewports will update the view.

@property (nonatomic, readonly) BOOL updatesPaused

Declared In

RBLazyLayoutView.h

  buttonAreaAnimator

The animator that is used when sliding the body view to reveal the button area. Default = [RBAnimator defaultSpringAnimator].

@property (nonatomic, readonly, nonnull) RBAnimator *buttonAreaAnimator

Declared In

RBLazyLayoutView.h

  transitionAnimator

The animator that is used when transitioning between states (none, highlighted, selected, disabled). Default = [RBAnimator defaultSpringAnimator] (with duration 0.1).

@property (nonatomic, readonly, nonnull) RBAnimator *transitionAnimator

Declared In

RBLazyLayoutView.h

– reloadData

Reloads the cells from the data source.

- (void)reloadData

Declared In

RBLazyLayoutView.h

– reloadCellAt:

Reloads the cells from the data source at the given index. Note only does so if the cell is currently visible.

- (void)reloadCellAt:(NSInteger)index

Parameters

index

The index of the cell.

Declared In

RBLazyLayoutView.h

– reusableCellWithType:configurationOnCreation:

Gets an instantiated or reused cell of the given type. The layout view is capable of managing multiple types. The returned cell will have theming applied on creation.

- (nonnull __kindof RBBaseCellView *)reusableCellWithType:(nonnull Class)cellType configurationOnCreation:(nullable void ( ^ ) ( __kindof RBBaseCellView *__nonnull cell ))configurationOnCreation

Parameters

cellType

The type of the cell to reuse or instantiate.

configurationOnCreation

An optional block to be called only on instantiation (not on reuse).

Return Value

The cell object for configuration.

Declared In

RBLazyLayoutView.h

– reusableCellWithType:shouldApplyTheming:configurationOnCreation:

Gets an instantiated or reused cell of the given type. The layout view is capable of managing multiple types.

- (nonnull __kindof RBBaseCellView *)reusableCellWithType:(nonnull Class)cellType shouldApplyTheming:(BOOL)applyTheming configurationOnCreation:(nullable void ( ^ ) ( __kindof RBBaseCellView *__nonnull cell ))configurationOnCreation

Parameters

cellType

The type of the cell to reuse or instantiate.

applyTheming

Whether or not to apply theming to the cell immediately on creation.

configurationOnCreation

An optional block to be called only on instantiation (not on reuse).

Return Value

The cell object for configuration.

Declared In

RBLazyLayoutView.h

– cellAtIndex:

The cell view at the given index if it is visible.

- (nullable RBBaseCellView *)cellAtIndex:(NSInteger)index

Parameters

index

The index of the cell.

Return Value

The cell view or nil if a cell with the requested index is out of range or is not visible.

Declared In

RBLazyLayoutView.h

– indexForCell:

The index of the given cell view. For cells that are not ‘on screen’ this will return nil.

- (NSInteger)indexForCell:(nonnull RBBaseCellView *)cell

Parameters

cell

The index of the cell.

Return Value

The index of the cell or NSNotFound if the cell is not visible or otherwise unavailable.

Declared In

RBLazyLayoutView.h

– isCellSelectedAt:

Indicates if the cell at the given index is currently selected.

- (BOOL)isCellSelectedAt:(NSInteger)index

Parameters

index

The index of the cell.

Return Value

Whether or not the cell is selected.

Declared In

RBLazyLayoutView.h

– isCellHighlightedAt:

Indicates if the cell at the given index is currently highlighted. Note this returns ONLY for cells highlighted using setCellHighlightedAt: method.

- (BOOL)isCellHighlightedAt:(NSInteger)index

Parameters

index

The index of the cell.

Return Value

Whether or not the cell is highlighted.

Declared In

RBLazyLayoutView.h

– isCellEnabledAt:

Indicates if the cell at the given index is currently enabled.

- (BOOL)isCellEnabledAt:(NSInteger)index

Parameters

index

The index of the cell.

Return Value

Whether or not the cell is enabled.

Declared In

RBLazyLayoutView.h

– setCellEnabled:at:animated:

Sets the enabled state of the cell at the given index. Ignores the allowsSelection, allowsMultipleSelection, zeroSelectionAllowed values. Events willEnable, didEnable etc are NOT raised when using this method.

- (BOOL)setCellEnabled:(BOOL)enabled at:(NSInteger)index animated:(BOOL)animated

Parameters

enabled

The enabled state to set.

index

The index of the cell.

animated

Animate the state change.

Return Value

Whether or not the state requested has been set.

Declared In

RBLazyLayoutView.h

– setCellSelected:at:animated:

Sets the selected state of the cell at the given index. Ignores the allowsSelection, allowsMultipleSelection, zeroSelectionAllowed values. Events willSelect, didSelect etc are NOT raised when using this method.

- (BOOL)setCellSelected:(BOOL)selected at:(NSInteger)index animated:(BOOL)animated

Parameters

selected

The selected state to set.

index

The index of the cell.

animated

Animate the state change.

Return Value

Whether or not the state requested has been set.

Declared In

RBLazyLayoutView.h

– setCellHighlighted:at:animated:

Sets the highlighted state of the cell at the given index. Ignores the allowsSelection, allowsMultipleSelection, zeroSelectionAllowed values. Events shouldHighlight, didHighlight etc are NOT raised when using this method.

- (BOOL)setCellHighlighted:(BOOL)highlighted at:(NSInteger)index animated:(BOOL)animated

Parameters

highlighted

The highlighted state to set.

index

The index of the cell.

animated

Animate the state change.

Return Value

Whether or not the state requested has been set.

Declared In

RBLazyLayoutView.h

– clearAllHighlightedCells:

Clears all the currently highlighted cells. Note this applies ONLY for cells highlighted using setCellHighlightedAt: method.

- (void)clearAllHighlightedCells:(BOOL)animated

Parameters

animated

Animate the state change.

Declared In

RBLazyLayoutView.h

– clearAllSelectedCells:

Clears all the currently selected cells.

- (void)clearAllSelectedCells:(BOOL)animated

Parameters

animated

Animate the state change.

Declared In

RBLazyLayoutView.h

– clearAllDisabledCells:

Clears all the currently disabled cells.

- (void)clearAllDisabledCells:(BOOL)animated

Parameters

animated

Animate the state change.

Declared In

RBLazyLayoutView.h

– openLeftButtonAreaAt:withAnimation:

Slide the body view to reveal the left button area to the user.

- (void)openLeftButtonAreaAt:(NSInteger)index withAnimation:(BOOL)animated

Parameters

index

The index of the cell on which to open the button area.

animated

Whether or not the transition should be animated.

Declared In

RBLazyLayoutView.h

– openRightButtonAreaAt:withAnimation:

Slide the body view to reveal the right button area to the user.

- (void)openRightButtonAreaAt:(NSInteger)index withAnimation:(BOOL)animated

Parameters

index

The index of the cell on which to open the button area.

animated

Whether or not the transition should be animated.

Declared In

RBLazyLayoutView.h

– closeButtonAreaWithAnimation:

Close the exposed button area cell.

- (void)closeButtonAreaWithAnimation:(BOOL)animated

Parameters

animated

Whether or not the transition should be animated.

Declared In

RBLazyLayoutView.h

– pauseUpdates

Pauses updates to the lazylayout view. This means no reloading fo cells, even on scrolling.

- (void)pauseUpdates

Declared In

RBLazyLayoutView.h

– resumeUpdates

Resumes updates to the lazylayout view. Will call reloadData if reloadData was called whilst paused.

- (void)resumeUpdates

Declared In

RBLazyLayoutView.h

– cellWillLoad:atIndex:

Called when the cell at the given index will be loaded.

- (void)cellWillLoad:(nonnull __kindof RBBaseCellView *)cell atIndex:(NSInteger)index

Parameters

cell

The cell that will be loaded.

index

The index of the cell in the layout.

Declared In

RBLazyLayoutView.h

– cellDidLoad:atIndex:

Called when the cell at the given index was loaded.

- (void)cellDidLoad:(nonnull __kindof RBBaseCellView *)cell atIndex:(NSInteger)index

Parameters

cell

The cell that was loaded.

index

The index of the cell in the layout.

Declared In

RBLazyLayoutView.h

– cellWillUnload:atIndex:

Called when the cell at the given index will be unloaded.

- (void)cellWillUnload:(nonnull __kindof RBBaseCellView *)cell atIndex:(NSInteger)index

Parameters

cell

The cell that will be unloaded.

index

The index of the cell in the layout.

Declared In

RBLazyLayoutView.h

– cellDidUnload:atIndex:

Called when the cell at the given index was unloaded.

- (void)cellDidUnload:(nonnull __kindof RBBaseCellView *)cell atIndex:(NSInteger)index

Parameters

cell

The cell that was unloaded.

index

The index of the cell in the layout.

Declared In

RBLazyLayoutView.h

– willReloadData

Called when the layout view will reload it’s cells from the data source.

- (void)willReloadData

Declared In

RBLazyLayoutView.h

– didReloadData

Called when the layout view has reloaded it’s cells from the data source.

- (void)didReloadData

Declared In

RBLazyLayoutView.h