Skip to main content

geometry_reader

Function geometry_reader 

Source
pub fn geometry_reader(
    builder: impl Fn(f64, f64) -> ViewHandle + 'static,
) -> ViewHandle
Expand description

GeometryReader { size in … }.

The builder receives the measured width and height, which is the whole point of a GeometryReader — a version that discarded the proxy would just be a container. The closure escapes, since SwiftUI re-runs it whenever the geometry changes, so its context is leaked.