swiftui button switch code example
Example: switch button swift 5
@IBAction func switch(_ sender: Any) {
if ((sender as AnyObject).isOn == true) {
//Yes
} else {
//No
}
}
@IBAction func switch(_ sender: Any) {
if ((sender as AnyObject).isOn == true) {
//Yes
} else {
//No
}
}