Contents

CFTreeInsertSibling(_:_:)

Inserts a new sibling after a given tree.

Declaration

func CFTreeInsertSibling(_ tree: CFTree!, _ newSibling: CFTree!)

Parameters

  • tree:

    The tree after which to insert newSibling. tree must have a parent.

  • newSibling:

    The sibling to add. newSibling must not have a parent.

Discussion

When a child tree is added to another tree, the child tree is retained by its new parent.

If you want to manipulate an existing tree structure, since newSibling must not have a parent you need to remove a tree from its parent in order to move it to a new position. If you do this, you should retain the tree before you actually remove it from its parent (see CFTreeRemove(_:)).

See Also

Modifying a Tree