A unique name for this coordinate space. Other components can reference this name in
GeometryProxy.frame() to get their position relative to this component.Assigns a named coordinate space to a component for geometry calculations.
.coordinateSpace(name: string)
GeometryProxy.frame() to get their position relative to this component.ScrollView([
VStack(items.map((item) =>
Text(item.name)
.visualEffect((builder, proxy) =>
builder.opacity(
proxy.frame("scroll").minY > 0 ? 1 : 0.3
)
)
))
])
.coordinateSpace("scroll")
VStack([
GeometryReader((proxy) =>
Text("Y: " + String(proxy.frame("container").minY))
)
])
.coordinateSpace("container")