Create

@objcMembers public final class Create: BlocklyEvent

Event fired when a block is added to the workspace, possibly containing other child blocks and next blocks.

  • The event type for BlocklyEvent.Create objects.

    Declaration

    Swift

    public static let EVENT_TYPE = "create"
  • xml

    The XML serialization of all blocks created by this event.

    Declaration

    Swift

    public let xml: String
  • The list of block ids for all blocks created by this event.

    Declaration

    Swift

    public let blockIDs: [String]
  • Constructs a BlocklyEvent.Create for the given block.

    Throws

    BlocklyError: Thrown if the given block tree could not be serialized into xml.

    Declaration

    Swift

    public init(workspace: Workspace, block: Block) throws
  • Constructs a BlocklyEvent.Create from the JSON serialized representation.

    Throws

    BlocklyError: Thrown when the JSON could not be parsed into a BlocklyEvent.Create object.

    Declaration

    Swift

    public init(json: [String: Any]) throws
  • Declaration

    Swift

    public override func toJSON() throws -> [String: Any]