Toolbox

@objcMembers open class Toolbox: NSObject

An object for grouping categories of template blocks together, so users can add them to a workspace.

  • A list of all categories in the toolbox

    Declaration

    Swift

    open private(set) var categories = [Category]()
  • Flag to set all categories in the toolbox to readOnly

    Declaration

    Swift

    open var readOnly: Bool = true
  • Adds a category to the toolbox.

    Declaration

    Swift

    open func addCategory(name: String, color: UIColor) -> Category

    Return Value

    The new category.

  • Adds a category to the toolbox.

    Declaration

    Swift

    open func addCategory(name: String, color: UIColor, icon: UIImage?) -> Category

    Return Value

    The new category.

  • Creates a new Toolbox from an XML string.

    Throws

    BlocklyError: Occurs if there is a problem parsing the xml (eg. insufficient data, malformed data, or contradictory data).

    Declaration

    Swift

    public class func makeToolbox(xmlString: String, factory: BlockFactory) throws
        -> Toolbox

    Return Value

    A Toolbox

  • Creates a new Toolbox from an XML object.

    Throws

    BlocklyError: Occurs if there is a problem parsing the xml (eg. insufficient data, malformed data, or contradictory data).

    Declaration

    Swift

    public class func makeToolbox(xml: AEXMLElement, factory: BlockFactory) throws -> Toolbox

    Return Value

    A Toolbox