我需要使用选择器和切换,并且需要更改基于切换值的选择器值。
我已尝试实现它,但它在选择器内显示切换,但我无法根据切换更改选择器值。
这是我到目前为止所尝试的:
Picker(selection: $bluetooth.type, label: BluetoothContainer()){
Toggle(isOn: self.$bluetooth.isBluetoothOn) {
Text("Bluetooth")
}
}