WorkspaceView

@objcMembers open class WorkspaceView: LayoutView

View for rendering a WorkspaceLayout.

  • Value representing a location within the workspace view.

    Declaration

    Swift

    public enum Location: Int
  • Convenience property for accessing self.layout as a WorkspaceLayout

    Declaration

    Swift

    open var workspaceLayout: WorkspaceLayout?
  • All top-level BlockGroupView instances underneath the workspace

    Declaration

    Swift

    open fileprivate(set) var blockGroupViews = Set<BlockGroupView>()
  • Scroll view used to render the workspace

    Declaration

    Swift

    open lazy var scrollView: WorkspaceView.ScrollView =
  • Optional layer used for dragging blocks. When set, block drags are automatically moved to this layer instead of the default one provided by WorkspaceView.

    Declaration

    Swift

    open var dragLayerView: ZIndexedGroupView!
  • Flag if the canvas should be padded with extra spaces around its edges via self.canvasPadding. If set to false, the user will only be allowed to scroll the exact amount needed to view all blocks. Note that padding is only added if there is at least one block in the workspace.

    Declaration

    Swift

    open var allowCanvasPadding: Bool = true
  • The amount of padding to apply to the edges of the workspace canvas, by percentage of view frame size

    Declaration

    Swift

    open var canvasPaddingScale = EdgeInsets(top: 0.5, leading: 0.2, bottom: 0.95, trailing: 0.9)
  • The amount of padding that should be added to the edges when automatically scrolling a Block into view or setting the viewport to a specific location.

    Declaration

    Swift

    open var scrollIntoViewEdgeInsets = EdgeInsets(top: 20, leading: 20, bottom: 100, trailing: 20)
  • Enables/disables the zooming of a workspace. Defaults to false.

    Declaration

    Swift

    open var allowZoom = false
  • Default initializer for workspace view.

    Declaration

    Swift

    public required init()
  • Returns the logical Workspace position of a given BlockView based on its position relative to this WorkspaceView.

    Declaration

    Swift

    public final func workspacePosition(fromBlockView blockView: UIView) -> WorkspacePoint

    Return Value

    The blockView’s corresponding workspace position.

  • Automatically adjusts the workspace’s scroll view to bring a given Block into view.

    Declaration

    Swift

    open func scrollBlockIntoView(_ block: Block, location: Location = .anywhere, animated: Bool)
  • Sets the content offset of the workspace’s scroll view so that a specific location in the workspace is visible.

    Declaration

    Swift

    open func setViewport(to location: Location, animated: Bool)
  • Maps a UIView point relative to self.scrollView to a logical Workspace position.

    Declaration

    Swift

    open func workspacePosition(fromViewPoint point: CGPoint) -> WorkspacePoint

    Return Value

    The corresponding WorkspacePoint

  • The scroll view used by WorkspaceView.

    Declaration

    Swift

    @objcMembers open class ScrollView: UIScrollView, UIGestureRecognizerDelegate