Tutorial by Examples

Objective-C [mySwitch setOn:YES]; //or [mySwitch setOn:YES animated:YES]; Swift mySwitch.setOn(false) //or mySwitch.setOn(false, animated: false)
Objective-C mySwitch.backgroundColor = [UIColor yellowColor]; [mySwitch setBackgroundColor: [UIColor yellowColor]]; mySwitch.backgroundColor =[UIColor colorWithRed:255/255.0 green:0/255.0 blue:0/255.0 alpha:1.0]; mySwitch.backgroundColor= [UIColor colorWithWhite: 0.5 alpha: 1.0]; mySwitch.backg...
Objective-C //for off-state mySwitch.tintColor = [UIColor blueColor]; [mySwitch setTintColor: [UIColor blueColor]]; //for on-state mySwitch.onTintColor = [UIColor cyanColor]; [mySwitch setOnTintColor: [UIColor cyanColor]]; Swift //for off-state mySwitch.tintColor = UIColor.blueColor() ...
Objective-C //set off-image mySwitch.offImage = [UIImage imageNamed:@"off_image"]; [mySwitch setOffImage:[UIImage imageNamed:@"off_image"]]; //set on-image mySwitch.onImage = [UIImage imageNamed:@"on_image"]; [mySwitch setOnImage:[UIImage imageNamed:@"on_im...

Page 1 of 1