ShelfWidgetRows

As many whole rows as fit the room, then "N more" (DroppyKit 1.23.0).

@MainActor struct ShelfWidgetRows<Data, ID, Row> where Data : RandomAccessCollection, ID : Hashable, Row : View

Never a half-cut row and never a scroll view that hides the overflow: the rows are laid out at the box they are given, and the richest composition that fits whole is drawn (ViewThatFits), every row, or the first few and a caption for the rest. In the single composition the list may scroll instead (scrollsWhenSingle), with Droppy's edge fade.

ShelfWidgetRows(clocks) { clock in
    ShelfWidgetValueRow(clock.city, value: clock.time)
}

Available from DroppyKit 1.23.0.

Initializers

init(_:id:maximumRows:scrollsWhenSingle:row:)

@MainActor init(_ data: Data, id: KeyPath<Data.Element, ID>, maximumRows: Int = 12, scrollsWhenSingle: Bool = false, @ViewBuilder row: @escaping (Data.Element) -> Row)

Creates the list.

  • Parameters:
  • data: The rows' data.
  • id: Each element's identity.
  • maximumRows: The most rows ever drawn; the rest are counted.
  • scrollsWhenSingle: Alone on the shelf, scroll through every row instead of counting the ones that do not fit.
  • row: One row.

init(_:maximumRows:scrollsWhenSingle:row:)

@MainActor init(_ data: Data, maximumRows: Int = 12, scrollsWhenSingle: Bool = false, @ViewBuilder row: @escaping (Data.Element) -> Row)

Creates the list over identifiable data.

Properties

body

@MainActor var body: some View { get }