ShelfWidgetNotchWrapTraits
How a widget's header row wraps around the camera, declared in notchWrap.
struct ShelfWidgetNotchWrapTraits
On a Mac with a notch, a widget that has the shelf to itself can rise into the two bands beside the camera, the way Droppy's own Notes, Pomodoro and Calendar do: its top row splits, one part left of the notch and one right of it, and everything under that row starts below the camera. The shelf gets shorter by roughly the row's height.
Declare the height of the header row as your classic layout draws it, inside contentInsets, and the narrowest band its two halves still fit in. When the host wraps the widget, it tells the mount through notchWrap; when that is nil (a grouped row, the Dynamic Island, an external display, a band narrower than you asked for, a host older than 1.21.0) lay the widget out exactly as before. The host grows the widget's rectangle by what the wrapped row adds over headerHeight, so a fixed content height stays the classic one.
Initializers
init(headerHeight:minimumBandWidth:)
init(headerHeight: CGFloat, minimumBandWidth: CGFloat = 56)
Creates the declaration.
Properties
headerHeight
let headerHeight: CGFloat
The classic header row's height, inside the content insets.
minimumBandWidth
let minimumBandWidth: CGFloat
The narrowest band, inside the content insets, that the row's leading or trailing half fits in. The host keeps the classic layout below it.