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:besideExtent:)

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

Creates the traits (1.26.0).

Compiled into the droplet and forwarded to the 1.23.0 initializer, so it needs no newer host than the type itself.

  • Parameters:
  • height: The classic header row's height.
  • besideExtent: How far the wider half reaches from the box's edge, labels included.

init(height:minimumBandWidth:)

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

Creates the traits under the old band name (1.23.0).

Superseded by init(height:besideExtent:) in 1.26.0, which takes the same number under the name the host's rule uses. Kept, unchanged, for droplets already built with it.

Type properties

standard

static let standard: ShelfWidgetHeaderTraits

ShelfWidgetHeader's row: 34pt, its halves reaching 64 from the box's edge.

Properties

besideExtent

var besideExtent: CGFloat { get }

How far the wider of the row's two halves reaches from the card's edge, where a wrapped row starts, control labels included (1.26.0). A host from 1.26.0 on wraps the row when fitsBesideCutout(surfaceWidth:cutoutWidth:besideExtent:) says it fits beside the cutout, and otherwise starts it just under the cutout. Compiled into the droplet (it reads the 1.23.0 property), so it needs no newer host than the type itself.

height

let height: CGFloat

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

minimumBandWidth

let minimumBandWidth: CGFloat

The number the host's wrap rule takes, under its 1.23.0 name: how far the wider of the row's two halves reaches. Read besideExtent.