HierarchyViewDataSource

public protocol HierarchyViewDataSource

An object that adopts the HierarchyViewDataSource protocol is responsible for providing the data required by a hierarchy view. It also handles the creation and configuration of cells used by the hierarchy view to display your data.

  • Gets the uuid for root item in hierarchy view. This method is only called when hierarchy view loads first time.

    Declaration

    Swift

    func rootID() -> String

    Return Value

    the uuid for root item in hierarchy view.

  • Gets the number of children for a given item ID

    Declaration

    Swift

    func numberOfChildren(for id: String) -> Int

    Parameters

    id

    The uuid of the item from which hierarchy view requests number of childre

    Return Value

    Number of children the item has.

  • Gets the uuid of a child of the specified parent item at given index.

    Declaration

    Swift

    func childID(idForChildItemAt index: Int, with parentID: String) -> String

    Parameters

    index

    The index of the child item

    parentID

    The uuid of the parent item.

    Return Value

    The uuid of child item.

  • Gets the uuid of the parent item of the specified child item.

    • parameter

      • id: The uuid of the child item whose parent is requested.

    Declaration

    Swift

    func parentID(for id: String) -> String?

    Return Value

    The uuid of the parent item or nil if parent does not exist.

  • Gets the title for the item with specified uuid.

    • parameter

      • uuid: The uuid of the item whose title is requested.

    Declaration

    Swift

    func itemTitle(for id: String) -> String?

    Return Value

    The title of the item or nil if it doesn’t have a title.