BlockGroupLayout

@objcMembers open class BlockGroupLayout: Layout

Abstract class that stores information on how to render and position a group of sequential Block objects (ie. those that are connecting via previous/next connections).

  • Flag that should be used when self.zIndex has been updated

    Declaration

    Swift

    public static let Flag_UpdateZIndex = LayoutFlag(0)
  • Flag that should be used when self.dragging has been updated

    Declaration

    Swift

    public static let Flag_UpdateDragging = LayoutFlag(1)
  • A list of sequential block layouts that belong to this group. While this class doesn’t enforce it, the following should hold true:

    1) When i < blockLayouts.count - 1:

    blockLayouts[i].block.nextBlock = blockLayouts[i + 1].block

    2) When i >= 1:

    blockLayouts[i].block.previousBlock = blockLayouts[i - 1].block

    Declaration

    Swift

    open fileprivate(set) var blockLayouts = [BlockLayout]()
  • Z-index of the layout

    Declaration

    Swift

    open var zIndex: UInt = 0
  • Flag indicating if this block group is being dragged

    Declaration

    Swift

    open var dragging: Bool = false
  • The largest leading edge X offset for every BlockLayout in self.blockLayouts

    Declaration

    Swift

    open var largestLeadingEdgeXOffset: CGFloat
  • Appends all blockLayouts to self.blockLayouts and sets their parentLayout to this instance.

    Declaration

    Swift

    open func appendBlockLayouts(_ blockLayouts: [BlockLayout], updateLayout: Bool = true)
  • Removes self.blockLayouts[index], sets its parentLayout to nil, and returns it.

    Declaration

    Swift

    open func removeBlockLayout(atIndex index: Int, updateLayout: Bool = true) -> BlockLayout

    Return Value

    The BlockLayout that was removed.

  • Appends a given BlockLayout instance to self.blockLayouts and adopts it as a child.

    If blockLayout had a previous BlockGroupLayout parent, it is removed as a child from that parent. Additionally, any children that followed this blockLayout in its old parent are also removed and appended to self.blockLayouts.

    Declaration

    Swift

    open func claimWithFollowers(blockLayout: BlockLayout, updateLayouts: Bool = true)
  • Removes a given block layout and all subsequent layouts from blockLayouts, and returns them in an array.

    Declaration

    Swift

    open func removeAllBlockLayouts(
        startingFrom blockLayout: BlockLayout, updateLayout: Bool = true) -> [BlockLayout]

    Return Value

    The list of block layouts that were removed, starting from the given block layout. If the given block layout could not be found, it is still returned as a single-element list.

  • Removes all elements from self.blockLayouts and sets their parentLayout to nil.

    Declaration

    Swift

    open func reset(updateLayout: Bool = true)
  • If this instance’s parentLayout is an instance of WorkspaceLayout, this method changes relativePosition to the position. If not, this method does nothing.

    Declaration

    Swift

    open func move(toWorkspacePosition position: WorkspacePoint, updateCanvasSize: Bool = true)