@IBOutlet weak var switch1: UISwitch! @IBOutlet weak var switch2: UISwitch! @IBOutlet weak var switch3: UISwitch! @IBAction func switch1Change(_ sender: UISwitch) { if switch1.isOn { switch2.setOn(false, animated: true) switch3.setOn(false, animated: true) } else { switch2.setOn(true, animated: true) switch3.setOn(true, animated: true) } }