RBLayoutPositioner Class Reference

Inherits from NSObject
Conforms to RBThemeTrackerDelegate
Declared in RBLayoutPositioner.h

Overview

The base layout view positioner class.

  theme

The theming tracker object for the view.

@property (nonatomic, readonly, nonnull) RBThemeTracker *theme

Discussion

The theming tracker object for the view.

Declared In

RBLayoutPositioner.h

  delegate

The delegate of the positioner, to receive the position invalidation event (causing a relayout).

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

Discussion

The delegate of the positioner, to receive the position invalidation event (causing a relayout).

Declared In

RBLayoutPositioner.h

  emptyContentSize

The content size required when there are no cells in the layout view.

@property (nonatomic, readonly) CGSize emptyContentSize

Discussion

The content size required when there are no cells in the layout view.

Declared In

RBLayoutPositioner.h

  viewportSize

The available viewport size for the positioning the cells.

@property (nonatomic) CGSize viewportSize

Discussion

The available viewport size for the positioning the cells.

Declared In

RBLayoutPositioner.h

  contentInsets

The content insets that are applied to the viewport.

@property (nonatomic) UIEdgeInsets contentInsets

Discussion

The content insets that are applied to the viewport.

Declared In

RBLayoutPositioner.h

  needsLayout

Whether or not the current result is invalid and the positioner needs to perform a layout.

@property (nonatomic, readonly) BOOL needsLayout

Discussion

Whether or not the current result is invalid and the positioner needs to perform a layout.

Declared In

RBLayoutPositioner.h

  result

The result of the last positioning operation.

@property (nonatomic, readonly, nullable) RBLayoutPositionerResult *result

Discussion

The result of the last positioning operation.

Declared In

RBLayoutPositioner.h

– invalidate

Invalidates the current result, prompting a relayout.

- (void)invalidate

Discussion

Invalidates the current result, prompting a relayout.

Declared In

RBLayoutPositioner.h

– layoutWithSizeBlock:viewCount:

Performs a layout operation, producing new frames for each cell.

- (void)layoutWithSizeBlock:(nonnull CGSize ( ^ ) ( NSUInteger index , CGSize container ))sizeBlock viewCount:(NSUInteger)viewCount

Parameters

sizeBlock

A block that can be called to get the recommended size of a cell given an available container size.

viewCount

The number of cells to position.

Discussion

Performs a layout operation, producing new frames for each cell.

Declared In

RBLayoutPositioner.h

– contentSizeWithViewportSize:sizeBlock:viewCount:

Prospectively performs a layout operation to determine what content size would be required to display those cells.

- (CGSize)contentSizeWithViewportSize:(CGSize)viewportSize sizeBlock:(nonnull CGSize ( ^ ) ( NSUInteger index , CGSize container ))sizeBlock viewCount:(NSUInteger)viewCount

Parameters

viewportSize

The available viewport size.

sizeBlock

A block that can be called to get the recommended size of a cell given an available container size.

viewCount

The number of cells to position.

Return Value

The resulting content size.

Discussion

Prospectively performs a layout operation to determine what content size would be required to display those cells.

Declared In

RBLayoutPositioner.h

  spacing

The spacing between cells in the positioner. A positioner should attempt to respect this as much as is possible. Depending on the positioner it may be ignored e.g. RBLayoutFlexiPositioner.

@property (nonatomic) CGFloat spacing

Discussion

The spacing between cells in the positioner. A positioner should attempt to respect this as much as is possible. Depending on the positioner it may be ignored e.g. RBLayoutFlexiPositioner.

Declared In

RBLayoutPositioner.h

  margin

The margin that should be provided around the collective cell bounds.

@property (nonatomic) UIEdgeInsets margin

Discussion

The margin that should be provided around the collective cell bounds.

Declared In

RBLayoutPositioner.h

  minimumSize

The minimum size that the layout view will size to when sizeThatFits: is called.

@property (nonatomic) CGSize minimumSize

Discussion

The minimum size that the layout view will size to when sizeThatFits: is called.

Declared In

RBLayoutPositioner.h

  maximumSize

The maximum size that the layout view will size to when sizeThatFits: is called.

@property (nonatomic) CGSize maximumSize

Discussion

The maximum size that the layout view will size to when sizeThatFits: is called.

Declared In

RBLayoutPositioner.h

– shouldInvalidateDueToContentInsetsChangeFrom:to:

Whether or not the given change of the content insets should invalidate the layout, causing a repositioning.

- (BOOL)shouldInvalidateDueToContentInsetsChangeFrom:(UIEdgeInsets)fromContentInsets to:(UIEdgeInsets)contentInsets

Parameters

fromContentInsets

The original content insets.

contentInsets

The new content insets.

Return Value

Whether or not the layout should be invalidated.

Discussion

Whether or not the given change of the content insets should invalidate the layout, causing a repositioning.

Declared In

RBLayoutPositioner.h

– calculateWithViewportSize:sizeBlock:viewCount:

Performs a recalculation of the layout.

- (nonnull RBLayoutPositionerResult *)calculateWithViewportSize:(CGSize)viewportSize sizeBlock:(nonnull CGSize ( ^ ) ( NSUInteger index , CGSize container ))sizeBlock viewCount:(NSUInteger)viewCount

Parameters

viewportSize

The available size of the viewport.

sizeBlock

A block that can be called to get the recommended size of a cell given an available container size.

viewCount

The number of cells to position.

Return Value

The result of the recalculation of the layout.

Discussion

Performs a recalculation of the layout.

Declared In

RBLayoutPositioner.h