Section

public struct Section<Item>

Represents and manages a section of items.

Properties

  • The elements in the section.

    Declaration

    Swift

    public var items: [Item]
  • The header title for the section.

    Declaration

    Swift

    public let headerTitle: String?
  • The footer title for the section.

    Declaration

    Swift

    public let footerTitle: String?
  • The number of elements in the section.

    Declaration

    Swift

    public var count: Int { get }

Initialization

  • Constructs a new section.

    Declaration

    Swift

    public init(items: Item..., headerTitle: String? = nil, footerTitle: String? = nil)

    Parameters

    items

    The elements in the section.

    headerTitle

    The section header title.

    footerTitle

    The section footer title.

  • Constructs a new section.

    Declaration

    Swift

    public init(_ items: [Item], headerTitle: String? = nil, footerTitle: String? = nil)

    Parameters

    items

    The elements in the section.

    headerTitle

    The section header title.

    footerTitle

    The section footer title.

Subscripts

  • Declaration

    Swift

    public subscript(index: Int) -> Item { get set }

    Parameters

    index

    The index of the item to return.

    Return Value

    The item at index.