BlockBuilder

@objcMembers public final class BlockBuilder: NSObject

Builder for creating Block instances.

  • The name of the block. Defaults to "".

    Declaration

    Swift

    public var name: String = ""
  • The color of the block. Defaults to UIColor.clear.

    Declaration

    Swift

    public var color: UIColor = UIColor.clear
  • Specifies the output connection is enabled. Defaults to false.

    Declaration

    Swift

    public private(set) var outputConnectionEnabled: Bool = false
  • Specifies the output type checks. Defaults to nil.

    Declaration

    Swift

    public private(set) var outputConnectionTypeChecks: [String]?
  • Specifies the next connection is enabled. Defaults to false.

    Declaration

    Swift

    public private(set) var nextConnectionEnabled: Bool = false
  • Specifies the next connection type checks. Defaults to nil.

    Declaration

    Swift

    public private(set) var nextConnectionTypeChecks: [String]?
  • Specifies the previous connection is enabled. Defaults to false.

    Declaration

    Swift

    public private(set) var previousConnectionEnabled: Bool = false
  • Specifies the previous connection type checks. Defaults to nil.

    Declaration

    Swift

    public private(set) var previousConnectionTypeChecks: [String]?
  • The builders for inputs on the block. Defaults to [].

    Declaration

    Swift

    public var inputBuilders: [InputBuilder] = []
  • Specifies the inputs are inline. Defaults to false.

    Declaration

    Swift

    public var inputsInline: Bool = false
  • The absolute position of the block, in the Workspace coordinate system. Defaults to WorkspacePoint.zero.

    Declaration

    Swift

    public var position: WorkspacePoint = WorkspacePoint.zero
  • Specifies a mutator to associate with the block. A copy of this mutator is attached to a block when it is built. Defaults to nil.

    Declaration

    Swift

    public var mutator: Mutator? = nil
  • Specifies extensions that should be run on the block during initialization. Defaults to [].

    Declaration

    Swift

    public var extensions = [BlockExtension]()
  • Specifies the style of the block.

    Declaration

    Swift

    public var style = Block.Style()
  • The tooltip of the block. Defaults to "".

    Declaration

    Swift

    public var tooltip: String = ""
  • The comment of the block. Defaults to "".

    Declaration

    Swift

    public var comment: String = ""
  • The help URL of the block. Defaults to "".

    Declaration

    Swift

    public var helpURL: String = ""
  • Specifies the block is deletable. Defaults to true.

    Declaration

    Swift

    public var deletable: Bool = true
  • Specifies the block is movable. Defaults to true.

    Declaration

    Swift

    public var movable: Bool = true
  • Specifies the block is editable. Defaults to true.

    Declaration

    Swift

    public var editable: Bool = true
  • Specifies the block is disabled. Defaults to false.

    Declaration

    Swift

    public var disabled: Bool = false
  • Initializes the block builder. Requires a name for the block to be built.

    Declaration

    Swift

    public init(name: String)
  • Initialize a builder from an existing block. All values that are not specific to a single instance of a block will be copied in to the builder. Any associated layouts are not copied into the builder.

    Declaration

    Swift

    public init(block: Block)
  • Creates a new block given the current state of the builder, assigned with a new UUID.

    Throws

    BlocklyError: Occurs if the block is missing any required pieces.

    Declaration

    Swift

    public func makeBlock(shadow: Bool) throws -> Block

    Return Value

    A new block.

  • Creates a new block given the current state of the builder.

    Throws

    BlocklyError: Occurs if the block is missing any required pieces.

    Declaration

    Swift

    public func makeBlock(shadow: Bool = false, uuid: String? = nil) throws -> Block

    Return Value

    A new block.

  • Specifies an output connection on the builder, and optionally the type checks to go with it.

    Throws

    BlocklyError: Occurs if the builder already has a next or previous connection.

    Declaration

    Swift

    public func setOutputConnection(enabled: Bool, typeChecks: [String]? = nil) throws
  • Specifies an next connection on the builder, and optionally the type checks to go with it.

    Throws

    BlocklyError: Occurs if the builder already has an output connection.

    Declaration

    Swift

    public func setNextConnection(enabled: Bool, typeChecks: [String]? = nil) throws
  • Specifies a previous connection on the builder, and optionally the type checks to go with it.

    Throws

    BlocklyError: Occurs if the builder already has an output connection.

    Declaration

    Swift

    public func setPreviousConnection(enabled: Bool, typeChecks: [String]? = nil) throws