ShelfWidgetHeaderTraits

The header row a widget's single composition starts with (DroppyKit 1.23.0), declared in init(single:split:splitMinimumWidth:pairWeight:header:).

struct ShelfWidgetHeaderTraits

Opt in with header: .standard when the widget starts with ShelfWidgetHeader (on its own or in ShelfWidgetScaffold): Droppy then wraps the row beside the camera on a notched Mac and the camera island wherever its halves fit, and the header block draws itself there. No numbers to keep in step: standard is the row the header block draws. Leave it nil (the default) for a widget with no such row. A widget that declares a header and does not draw ShelfWidgetHeader while wrapped is not wrapped again: the host checks, so nothing lands under the camera.

Available from DroppyKit 1.23.0.

Initializers

init(height:minimumBandWidth:)

init(height: CGFloat = DroppyWidgetMetrics.single.headerHeight, minimumBandWidth: CGFloat = DroppyWidgetMetrics.wrapMinimumBandWidth)

Creates the traits.

Type properties

standard

static let standard: ShelfWidgetHeaderTraits

ShelfWidgetHeader's row: 34pt, wrapping into a band of 64 or more.

Properties

height

let height: CGFloat

The classic header row's height, inside the box.

minimumBandWidth

let minimumBandWidth: CGFloat

The narrowest band beside the camera the row's halves fit in.