[yourSwitchObject addTarget:self action:@selector(setState:) forControlEvents:UIControlEventValueChanged];
This will call the below method when your switch state changes
- (void)setState:(id)sender
{
BOOL state = [sender isOn];
NSString *rez = state == YES ? @"YES" : @"NO";
NSLog(rez);
}