Index

RBPositoner.swift

Protocols

Classes


RBPositioner

Properties

The theming tracker object for the view.
public var theme RBThemeTracker { get }

The delegate of the positioner, to receive the position invalidation event (causing a relayout).
public weak var delegate RBPositionerDelegate? { get set }

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. RBFlexiPositioner.
public var spacing CGFloat { get set }

The margin that should be provided around the collective cell bounds.
public var margin UIEdgeInsets { get set }

The minimum size that the layout view will size to when sizeThatFits: is called.
public var minimumSize CGSize { get set }

The maximum size that the layout view will size to when sizeThatFits: is called. Note this is particularly useful when you have multiple embedded RBLayoutViews that have expanding positioners (e.g. RBGridPositioner). These in specific configurations attempt to expand the cell size and layout to consume all available space as a viewport of 1000000 maybe passed to the embedded RBLayoutView it may need to be restricted via the maximumSize property.
public var maximumSize CGSize { get set }

The content size required when there are no cells in the layout view.
public var emptyContentSize CGSize { get set }

The available viewport size for the positioning the cells.
public var viewportSize CGSize { get set }

The content insets that are applied to the viewport.
public var contentInsets UIEdgeInsets { get set }

Whether or not the current result is invalid and the positioner needs to perform a layout.
public var needsLayout Bool { get }

The result of the last positioning operation.
public var result RBPositionerResult? { get }

Functions

Invalidates the current result, prompting a relayout.
public func invalidate()

Whether or not the given change of the content insets should invalidate the layout, causing a repositioning.
@param from : The original content insets.
@param to : The new content insets.
@returns Whether or not the layout should be invalidated. Default = true
open func shouldInvalidateDueToContentInsets(from: UIEdgeInsets, to: UIEdgeInsets) -> Bool

Performs a recalculation of the layout.
@param numberOfViews : The number of cells to position.
@param viewPort : The available viewport size.
@param sizeBlock : A block that can be called to get the recommended size of a cell given an available container size.
@returns The result of the recalculation of the layout.
open func calculate(numberOfViews: Int, viewPort: CGSize, sizeBlock: (_ index: Int, _ container: CGSize) -> CGSize) -> RBPositionerResult

open func applyTheme(_ theme: [String : Any])

open class func generateThemeSchema(withParent parent: RBThemeSchema?) -> RBThemeSchema

public class func sizeOf(positioner: RBPositioner, views: [UIView], size: CGSize) -> CGSize

public class func position(positioner: RBPositioner, views: [UIView], parent: UIView, frame: CGRect, animator: RBAnimator? = nil, completion: ((_ contentSize: CGSize) -> Void)?)

public class func union(frames: inout [CGRect]) -> CGRect