CategoryTree

public protocol CategoryTree

Category tree protocol.

  • The root categories.

    Declaration

    Swift

    var rootCategories: [CategoryType]
  • The mapped categories object.

    Declaration

    Swift

    var categoryMap: [String: CategoryType]
  • The default initializer. init(categories: [CategoryType]) is preferred to create the category tree.

    Declaration

    Swift

    init()
  • init(categories:) Default implementation

    Creates a category tree with the given flat categories array.

    Default Implementation

    Creates a category tree with the given flat categories array.

    Declaration

    Swift

    init(categories: [CategoryType])

    Parameters

    categories

    The categories to use.

  • subCategories(forCategory:) Default implementation

    Returns the sub-categories for the given category. If the array is empty it means the given category is a leaf.

    Default Implementation

    Returns the sub-categories for the given category. If the array is empty it means the given category is a leaf.

    Declaration

    Swift

    func subCategories(forCategory category: CategoryType) -> [CategoryType]

    Parameters

    category

    The category to get sub-categories from.

    Return Value

    The sub-categories available.