Set Tint Color
suggest changetintColor tints the off outline. onTintColor tints the on track. These Swift calls are Swift 2.
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()
//for on-state
mySwitch.onTintColor = UIColor.cyanColor()
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents