Programming/iOS - ObjC

UISwitch - 상태값 가져오기

Tez.Park 2014. 12. 4. 16:42



UISwitch On/Off 상태 가져오기




UISwitch* whatSwitch = [[UISwitch alloc] init~~];
...
if (whatSwitch.on == YES) { 
      //Do stuff 
} 
else if (whatSwitch.on == NO) { 
      // Do other stuff 
} 
else { 
      // Do stuff if whatSwitch is nil 
}


반응형