Category Archives: Switch on and off

Switch on and off

// you have to use ifElse for SwitchObject
@IBAction func switchOnOff(_ sender: AnyObject) {
doUwantPizzaLabel.text = “”
if sender.isOn == true{
yesIwantTpiza.text = “yes, i want to piza now”
}else{
yesIwantTpiza.text = “sorry, i don’t want to pizza”
}
}