Skip to main content

frame_max_width

Function frame_max_width 

Source
pub fn frame_max_width(view: &ViewHandle, alignment: Alignment) -> ViewHandle
Expand description

Apply .frame(maxWidth: .infinity) — the width only.

Not frame_max_infinity, which sets both axes. Swift’s .frame(maxWidth: .infinity) leaves maxHeight nil, so the view keeps its content’s height; setting both stretched a card to fill its canvas and moved everything in it.

Six Optional<CGFloat>s — min, ideal and max for each axis — then an Alignment, then the two generic words. Each optional is payload and tag, so that is sixteen words in all: x0 through x7 carry the first four optionals and the remaining eight go on the stack. The generic arguments come after every formal parameter, which is what makes them spill; putting them in x6 and x7 builds a frame out of the metadata pointers.