Skip to main content

frame_optional

Function frame_optional 

Source
pub fn frame_optional(
    view: &ViewHandle,
    width: Option<f64>,
    height: Option<f64>,
    alignment: Alignment,
) -> ViewHandle
Expand description

Apply .frame(width:height:alignment:) with either dimension left out.

frame(height: 100) is not frame(width: 0, height: 100) — an omitted dimension means “take what the parent offers”, and the Optional<CGFloat> carries that in its tag: payload then tag, 0 for .some and 1 for .none.