LayoutBlock
public final class LayoutBlock<Item> : LayoutBlockProtocol where Item : LayoutElement
                Makes full layout for LayoutElement entity. Contains main layout, related anchor constrains and element for layout.
- 
                  
                  
Undocumented
Declaration
Swift
public private(set) weak var item: Item? - 
                  
                  
Declaration
Swift
public var isActive: Bool { get } - 
                  
                  
Undocumented
Declaration
Swift
public func setItem(_ item: Item?) - 
                  
                  
Undocumented
Declaration
Swift
public func setLayout(_ layout: RectBasedLayout) - 
                  
                  
Undocumented
Declaration
Swift
public func setConstraints(_ constraints: [LayoutConstraintProtocol]) - 
                  
                  
Snapshot for current state without recalculating
Declaration
Swift
public var currentSnapshot: LayoutSnapshotProtocol { get } - 
                  
                  
Undocumented
Declaration
Swift
public var currentRect: CGRect { get } - 
                  
                  
Undocumented
Declaration
Swift
public init(element: Item?, layout: RectBasedLayout, constraints: [LayoutConstraintProtocol] = []) - 
                  
                  
Calculate and apply frames layout elements. Should be call when parent
LayoutElementelement has corrected bounds. Else result unexpected.Declaration
Swift
public func layout() - 
                  
                  
Calculate and apply frames layout elements in custom space.
Declaration
Swift
public func layout(in sourceRect: CGRect)Parameters
sourceRectSource space
 - 
                  
                  
Returns snapshot for all
LayoutElementelements in block. Attention: in during calculating snapshot frames of layout elements must not changed.Declaration
Swift
public func snapshot(for sourceRect: CGRect) -> LayoutSnapshotProtocolParameters
sourceRectSource space for layout
Return Value
Snapshot contained frames layout elements
 - 
                  
                  
Method for perform layout calculation in child blocks. Does not call this method directly outside
LayoutBlockProtocolobject. Layout block should be insert containedLayoutElementelements to completedRectsDeclaration
Swift
public func snapshot(for sourceRect: CGRect, completedRects: inout [(AnyObject, CGRect)]) -> LayoutSnapshotProtocolParameters
sourceRectSource space for layout. For not top level blocks rect should be define available bounds of block
completedRectsLayoutElementelements with corrected frameReturn Value
Frame of this block
 - 
                  
                  
Applying frames from snapshot to
LayoutElementelements in this block. Snapshot array should be ordered such to matchLayoutElementelements sequence.Declaration
Swift
public func apply(snapshot: LayoutSnapshotProtocol)Parameters
snapshotSnapshot represented as array of frames.
 
        LayoutBlock Class Reference