Skip to main content

toggle_labelled

Function toggle_labelled 

Source
pub fn toggle_labelled(
    label: &ViewHandle,
    state: &BoundState<bool>,
) -> ViewHandle
Expand description

Toggle(isOn:) { label } — a toggle whose label is any view.

toggle_bound takes a string, which becomes a Text. The convenience that takes a symbol name — Toggle(_:systemImage:isOn:) — is inlinable and exports nothing, so it cannot be called; but it only builds a Label, and this takes any view at all. Toggle(isOn:) { label("Wi-Fi", "wifi") } gets there and more.