ShelfWidgetNotchWrap

The bands beside the camera for a widget the host wrapped around the notch or the camera island, handed down in notchWrap.

struct ShelfWidgetNotchWrap

Both numbers are inside contentInsets, which is zero on every edge while the widget is wrapped (the host clips a wrapped card square): after the root's .padding(context.contentInsets), the first headerHeight points of the widget start at the card's top edge, beside the camera, exactly where Droppy's own wrapped rows start, with bandWidth usable on each side from the card's edge and the middle under the notch, or around the camera island's pill, where nothing may draw. Put the header row's two halves in the bands with ShelfWidgetNotchWrapRow, Droppy's own wrapped row (1.22.0), and start the rest under the row; never raise or lower the row yourself:

VStack(spacing: 0) {
    if let wrap = context.notchWrap {
        ShelfWidgetNotchWrapRow(wrap) {
            title
        } trailing: {
            addButton
        }
    } else {
        HStack { title; Spacer(); addButton }
    }
    list
}
.padding(context.contentInsets)

headerHeight is never less than the declared headerHeight, and grows when the camera is taller than the row, so that what follows the row clears it. On the camera island the row starts 16pt under the island's top, which stands 2.5pt above the pill's, and headerHeight grows until what follows clears the pill's floor (33.5pt under the island's top for the 31pt pill).

Initializers

init(headerHeight:bandWidth:)

init(headerHeight: CGFloat, bandWidth: CGFloat)

Creates the geometry. Constructed by hosts, read by droplets.

init(headerHeight:bandWidth:cutoutWidth:)

init(headerHeight: CGFloat, bandWidth: CGFloat, cutoutWidth: CGFloat)

Creates the geometry including the central cutout width between the two bands. Constructed by hosts, read by droplets.

Available from DroppyKit 1.24.0.

Properties

bandWidth

let bandWidth: CGFloat

Usable width of each band: from the content edge to the notch, or to the clearance around the camera island's pill.

cutoutWidth

let cutoutWidth: CGFloat

Center cutout width between the two bands (0 when unspecified by an earlier host; every Droppy so far leaves it 0, so measure the gap from the bands rather than from this).

Available from DroppyKit 1.24.0; a droplet that uses it declares minAPI 1.24.0.

headerHeight

let headerHeight: CGFloat

Height of the row beside the camera.