MenuDataSource

public struct MenuDataSource<Item> : MenuDataSourceProtocol where Item : MenuItem

A MenuDataSource is a concrete implementation of MenuDataSourceProtocol and is used in MenuViewController as a data source for the menu.

  • The items in this data source.

    Declaration

    Swift

    public var items: [Item]
  • Creates a new data source with the given items.

    Declaration

    Swift

    public init(items: [Item])

    Parameters

    items

    The items in this data source.

  • Creates a new data source with the given items.

    Declaration

    Swift

    public init(items: Item...)

    Parameters

    items

    The items in this data source.

  • Returns the index path for the given item, if the item exists in this data source.

    Declaration

    Swift

    public func indexPath(for item: Item) -> IndexPath?

    Parameters

    item

    The item for which the index path is needed.

    Return Value

    The index path of the given item or nil.