Skip to main content

tuple_view

Function tuple_view 

Source
pub fn tuple_view(children: &[ViewHandle]) -> ViewHandle
Expand description

TupleView<(A, B, …)> — what a @ViewBuilder makes of several views, with no container around them.

A List renders each element of its content as a row, so List { Text("a"); Text("b") } is two rows. Without this the nearest the bindings could get was list(&vstack(&[a, b])) — one row holding a stack — and the parity corpus records that: its List case spells the Swift as List { AnyView(VStack { … }) } so the two sides agree. They agreed about the wrong thing.

A single child collapses to itself, as ViewBuilder does: TupleView of one is not a type Swift ever builds.