Skip to content
This repository has been archived by the owner on Oct 17, 2021. It is now read-only.

ContainerOfBlocks

mattt edited this page Jan 25, 2020 · 9 revisions

ContainerOfBlocks

public protocol ContainerOfBlocks: Node

Inheritance

Node, Equatable, CustomStringConvertible, Hashable


Required Properties

children

The block's children.

var children: [Block & Node]

description

var description: String

Required Methods

prepend(child:)

Adds a block to the beginning of the block's children.

@discardableResult public func prepend(child: Block & Node) -> Bool

Parameters

  • child: The block to add.

Returns

true if successful, otherwise false.

append(child:)

Adds a block to the end of the block's children.

@discardableResult public func append(child: Block & Node) -> Bool

Parameters

  • child: The block to add.

Returns

true if successful, otherwise false.

insert(child:before:)

Inserts a block to the block's children before a specified sibling.

@discardableResult public func insert(child: Block & Node, before sibling: Block & Node) -> Bool

Parameters

  • child: The block to add.
  • sibling: The child before which the block is added

Returns

true if successful, otherwise false.

insert(child:after:)

Inserts a block to the block's children after a specified sibling.

@discardableResult public func insert(child: Block & Node, after sibling: Block & Node) -> Bool

Parameters

  • child: The block to add.
  • sibling: The child after which the block is added

Returns

true if successful, otherwise false.

remove(child:)

Removes a block from the block's children.

@discardableResult public func remove(child: Block & Node) -> Bool

Parameters

  • child: The block to remove.

Returns

true if successful, otherwise false.

==(lhs:rhs:)

public static func ==(lhs: Node, rhs: Node) -> Bool

hash(into:)

public func hash(into hasher: inout Hasher)
Clone this wiki locally