Objective-C
[mySwitch setOn:YES]; //or [mySwitch setOn:YES animated:YES];
Swift
mySwitch.setOn(false) //or mySwitch.setOn(false, animated: false)