ShelfWidgetNotchWrap
The bands beside the camera for a widget the host wrapped around the notch, 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, where nothing may draw. Put the header row's two halves in the bands and start the rest under the row; never raise or lower the row yourself:
VStack(spacing: 0) {
if let wrap = context.notchWrap {
HStack(spacing: 0) {
title.frame(maxWidth: wrap.bandWidth, alignment: .leading)
Spacer(minLength: 0)
addButton.frame(maxWidth: wrap.bandWidth, alignment: .trailing)
}
.frame(height: wrap.headerHeight, alignment: .top)
} 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.
Initializers
init(headerHeight:bandWidth:)
init(headerHeight: CGFloat, bandWidth: CGFloat)
Creates the geometry. Constructed by hosts, read by droplets.
Properties
bandWidth
let bandWidth: CGFloat
Usable width of each band: from the content edge to the notch.
headerHeight
let headerHeight: CGFloat
Height of the row beside the camera.