swift .toggle() code example
Example: swift toggle on change
Toggle(isOn: $state){
Text("This is a toggle")
}
.onChange(of: state) {
// The action you want to trigger
}
Toggle(isOn: $state){
Text("This is a toggle")
}
.onChange(of: state) {
// The action you want to trigger
}