title: How to change UISwitch default color for OFF state?
body: <p>I want to change the color of  onTintColor in the UISwitch for the off State. The switch is in tableview and switch is made programmatically.</p>
  
  <pre><code>    [settingsSwitch setBackgroundColor:[UIColor whiteColor]];
      [settingsSwitch setTintColor:[UIColor whiteColor]];
      [settingsSwitch setThumbTintColor:[UIColor redColor]];
      [settingsSwitch setOnTintColor:[UIColor colorWithRed:138/256.0  green:9/256.0 blue:18/256.0 alpha:1]];
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/iHKMA.png" alt="enter image description here"></p>
  
  <p>This is the result i get when i set the background color white.</p>
  
  <p><img src="https://i.stack.imgur.com/UuPOT.png" alt="enter image description here"></p>
  
  <p>And without background i get red color which is the color of my cell.</p>
  
  <p><img src="https://i.stack.imgur.com/KZaTu.png" alt="enter image description here"></p>
  
  <p>and this is the result i want, when switch is on the onTintColor should b dark red, and in off state it should be white.</p>
  
  <p>i tried setting the image on switch with this line of code</p>
  
  <pre><code>[settingsSwitch setOnImage:[UIImage imageNamed:@"on.png"]];
  [settingsSwitch setOffImage:[UIImage imageNamed:@"off.png"]];
  </code></pre>
  
  <p>But its not changing the images.
  i want to change the color of switch in off state.
  Hope i have explained my question clearly.thanks for helping in advance.</p>