Skip to main content

toggle_app_storage

Function toggle_app_storage 

Source
pub fn toggle_app_storage(label: &str, stored: &StoredView<bool>) -> ViewHandle
Expand description

Toggle(label, isOn: $flag) — a toggle driven directly by a real @AppStorage.

No Rust state sits in between: the binding is the one the property wrapper projects, so flipping the toggle writes through UserDefaults and re-runs the owning view’s body. toggle_bound is the counterpart for state Rust owns.