How do I disable a UISwitch?

Is this possible to disable a UISwitch? I do not mean putting it in an OFF state, I mean disabling user interaction, and having it appear gray.

In my app I have two conditions

if (condition == true) {  
  // UISwitch should be enabled  
} else {  
  // UISwitch should be visible, but disabled  
  // e.g uiswitch.enable=NO;  
} 

Any suggestions?

18
задан Micah Hainline 14 April 2011 в 14:03
поделиться